Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file options.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227(**************************************************************************)(* *)(* This file is part of the Frama-C's Lannotate plug-in. *)(* *)(* Copyright (C) 2012-2022 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU 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) *)(* *)(**************************************************************************)let()=Plugin.is_share_visible()includePlugin.Register(structletname="LAnnotate"letshortname="lannot"lethelp="generate labels"end)letrecstring_listl=matchlwith|[]->""|a::[]->a|a::b::[]->a^" and "^b|head::tail->head^", "^string_listtailmoduleAnnotators=String_set(structletoption_name="-lannot"letarg_name="criteria"lethelp="enable annotation and generate labels for each criterion (comma-separated \
list of criteria, see -lannot-list)"end)let()=Annotators.add_aliases["-lannotate"]moduleOutput=Empty_string(structletoption_name="-lannot-o"letarg_name="file"lethelp="set output file (default: add _labels before extension)"end)let()=Output.add_aliases["-lannot-output"]moduleSimplify=False(structletoption_name="-lannot-simplify"lethelp="enable the simplification of boolean expressions before annotations"end)moduleDoFunctionNames=Kernel_function_set(structletarg_name="funs"letoption_name="-lannot-functions"lethelp="filter by function names (disabled by default)"end)moduleSkipFunctionNames=Kernel_function_set(structletarg_name="funs"letoption_name="-lannot-skip-functions"lethelp="filter by function names (disabled by default)"end)moduleDoVariableNames=String_set(structletarg_name="vars"letoption_name="-lannot-vars"lethelp="filter by variable names (disabled by default)"end)moduleSkipVariableNames=String_set(structletarg_name="vars"letoption_name="-lannot-skip-vars"lethelp="filter by variable names (disabled by default)"end)let()=Parameter_customize.set_grouphelplet()=Parameter_customize.do_not_projectify()let()=Parameter_customize.do_not_save()let()=Parameter_customize.set_cmdline_stageCmdline.ExtendedmoduleListAnnotators=False(structletoption_name="-lannot-list"lethelp="show list of criteria"end)letcrit_group=add_group"Criterion-specific options"moduleAllBoolExps=False(structletoption_name="-lannot-allbool"lethelp="indicates that in addition to branching condition, \
all boolean expression should be taken into account \
(for CC, n-CC, MCC, DC, GACC and GICC coverage)"end)let()=Parameter_customize.set_groupcrit_groupmoduleN=Int(structletoption_name="-lannot-n"letarg_name="N"lethelp="set the n parameter for n-CC (n-wise Condition Coverage) \
(0 means MCC and 1 means CC)"letdefault=2end)let()=Parameter_customize.set_groupcrit_groupletmutators=["AOR";"ROR";"COR";"ABS"]moduleMutators=Filled_string_set(structletoption_name="-lannot-mutators"letarg_name="mutators"lethelp="select mutators for WM labelling (comma-separated list \
of mutators among "^string_listmutators^", default: all)."^"Mutators prefixed with '-' are removed from the list"letdefault=Datatype.String.Set.of_listmutatorsend)letipd_group=add_group"Options for Input Domain Partionning (IPD)"let()=Parameter_customize.set_groupipd_groupmoduleMaxWidth=Int(structletoption_name="-lannot-maxwidth"letarg_name="NUM"lethelp="set the maximum number of elements to partition in arrays \
and structures (default: 5)"letdefault=5end)let()=Parameter_customize.set_groupipd_groupmoduleMaxDepth=Int(structletoption_name="-lannot-maxdepth"letarg_name="NUM"lethelp="set the maximal depth to partition, i.e. the maximum number \
of pointer indirections and field accesses (default: 5)"letdefault=5end)let()=Parameter_customize.set_groupipd_groupmoduleAllFuns=False(structletoption_name="-lannot-allfuns"lethelp="if IPD is enabled, inputs for all functions should be treated \
(not only main)"end)let()=Parameter_customize.set_groupipd_groupmoduleGlobalsAsInput=False(structletoption_name="-lannot-globals"lethelp="global variables should be considered as input \
(disabled by default)"end)let()=Parameter_customize.set_groupcrit_groupmoduleLimitDelta=Int(structletoption_name="-lannot-limit-delta"letarg_name="NUM"lethelp="Set the precision of limit labels (Default : 0)"letdefault=0end)let()=LimitDelta.set_range~min:0~max:max_intlet()=Parameter_customize.set_groupcrit_groupmoduleBoundPostpone=False(structletoption_name="-lannot-bound-postpone"lethelp="Postpone bound evaluation to the use label (Default : false)"end)moduleInline=True(structletoption_name="-lannot-inline"lethelp="Annotate inline functions (Default : true)"end)moduleInlinedBlock=False(structletoption_name="-lannot-inlined-block"lethelp="Annotate inlined block from inline functions (Default : true)"end)letdataflow=add_group"Dataflow criterion-specific options"let()=Parameter_customize.set_groupdataflowmoduleCleanDataflow=True(structletoption_name="-lannot-clean"lethelp="Clean trivially infeasible sequence"end)let()=Parameter_customize.set_groupdataflowmoduleCleanEquiv=True(structletoption_name="-lannot-clean-equiv"lethelp="Remove equivalent sequences and annotate lval only once per expr"end)let()=Parameter_customize.set_groupdataflowmoduleMaxContextPath=Int(structletoption_name="-lannot-maxpath"letarg_name="NUM"lethelp="set the maximum number of path for one expression with the context criteria (Default : 1024)"letdefault=1024end)let()=Parameter_customize.set_groupdataflowmoduleVisibility=False(structletoption_name="-lannot-visibility"lethelp="Transform labels into sequences (from label to return) (Default : false)"end)(* There is no way to determine the original loop form after the CIL transformation.
Since loops criterias depend on if we are in a while or do..while.. I added this option to
tell to Lannotate if we support do..while.. or not. See doc/LOOPS.markdown for examples
*)moduleHandleDoWhile=True(structletoption_name="-lannot-handle-dowhile"lethelp="Do..While.. will be supported in loops criterias, but empty loops will also be considered as Do..While.. (default: true)"end)moduleHandleStruct=True(structletoption_name="-lannot-handle-struct"lethelp="WIP: for def-use analysis (default: false)"end)moduleMaxMutation=Int(structletoption_name="-lannot-max-mutation"letarg_name="NUM"lethelp="set the maximum number of possible mutation for RCC criteria (Default : 1)"letdefault=1end)