123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124(**************************************************************************)(* *)(* This file is part of the Frama-C's MetACSL plug-in. *)(* *)(* Copyright (C) 2018-2025 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU 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) *)(* *)(**************************************************************************)lethelp_msg="This plugin translates the metaproperties in the code to native ACSL annotations"^"that can then be checked."let()=Plugin.is_share_visible()moduleSelf=Plugin.Register(structletname="MetAcsl"letshortname="meta"lethelp=help_msgend)let()=Parameter_customize.do_not_projectify()moduleEnabled=Self.False(structletoption_name="-meta"lethelp="Enable translation of metaproperties"end)moduleCheck_External=Self.True(structletoption_name="-meta-check-ext"lethelp="Calls to external functions (such as memcpy) are treated as \
modifying/accessing the state inside the caller's body"end)let()=Parameter_customize.argument_may_be_fundecl()moduleCheck_Callee_Assigns=Self.Kernel_function_set(structletoption_name="-meta-check-callee-assigns"letarg_name="f,..."lethelp="Reading and writing metaproperties are instantiated for calls \
to listed functions from non-listed ones based on the \
assigns...from clauses of the callee (possibly in addition to \
their instantiation inside the callee when it is in the target set)."end)moduleTargets=Self.String_set(structletoption_name="-meta-set"letarg_name="targets"lethelp="Define the set of meta-properties to process. Defaults to \
every meta-property"end)moduleSimpl=Self.True(structletoption_name="-meta-simpl"lethelp="Discard annotations that are obviously true"end)moduleNumber_assertions=Self.False(structletoption_name="-meta-number-assertions"lethelp="Add an unique number to each instance of a meta-propery."end)modulePrefix_meta=Self.True(structletoption_name="-meta-add-prefix"lethelp="Prefix meta: to the name of each generated property."end)moduleList_targets=Self.False(structletoption_name="-meta-list-targets"lethelp="Detail the list of targets for every meta-property"end)moduleKeep_proof_files=Self.False(structletoption_name="-meta-keep-proof-files"lethelp="Keep .why files after deduction attempts"end)moduleStatic_bindings=Self.Int(structletoption_name="-meta-static-bindings"letarg_name="array_size"letdefault=0lethelp="Use static arrays with the given size for bindings instead \
of dynamic arrays"end)moduleSeparate_annots=Self.False(structletoption_name="-meta-separate-annots"lethelp="When set, each generated statement annotation will be tied to its own \
(nop) instruction. Otherwise (default), all annotations generated for \
a given statement will be tied to this statement."end)let()=Parameter_customize.set_negative_option_name"-meta-checks"moduleDefault_to_assert=Self.True(structletoption_name="-meta-asserts"lethelp="Default to using assertions instead of checks when translating, \
unless specified otherwise in a meta-property"end)letunknown_func_wkey=Self.register_warn_category"unknown-func"let()=Self.set_warn_statusunknown_func_wkeyLog.Waborttypemeta_flags={check_external:bool;check_callee_assigns:Kernel_function.Set.t;simpl:bool;static_bindings:intoption;target_set:Meta_utils.StrSet.toption;number_assertions:bool;prefix_meta:bool;list_targets:bool;keep_proof_files:bool;default_to_assert:bool;}