123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162(**************************************************************************)(* *)(* This file is part of WP plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat a l'energie atomique et aux energies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)openCil_typestypescope=|SC_Global|SC_Frame_in|SC_Frame_out|SC_Block_in|SC_Block_outtypeeffect_source=|FromCode|FromCall|FromReturntypeterminates_source=|Loop|Terminates|Decreases|MissingTerminates|MissingDecreases|Dependenciestypegoal_source=|Effectofeffect_source|Terminatesofterminates_sourcemoduletypeExport=sigtypepredtypedeclvalexport_section:Format.formatter->string->unitvalexport_goal:Format.formatter->string->pred->unitvalexport_decl:Format.formatter->decl->unitendmoduletypeSplitter=sigtypepredvalsimplify:pred->predvalsplit:bool->pred->predBag.tend(**
* 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.
**)moduletypeS=sigtypet_envtypet_propvalpretty:Format.formatter->t_prop->unitvalmerge:t_env->t_prop->t_prop->t_propvalempty:t_prop(** optionally init env with user logic variables *)valnew_env:?lvars:Cil_types.logic_varlist->kernel_function->t_envvaladd_axiom:WpPropId.prop_id->LogicUsage.logic_lemma->unitvaladd_hyp:?for_pid:WpPropId.prop_id->t_env->WpPropId.pred_info->t_prop->t_propvaladd_goal:t_env->WpPropId.pred_info->t_prop->t_propvaladd_terminates_subgoal:t_env->WpPropId.prop_id*'a->?deps:Property.Set.t->predicate->stmt->terminates_source->t_prop->t_propvaladd_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.*)valuse_assigns:t_env->WpPropId.prop_idoption->WpPropId.assigns_desc->t_prop->t_propvallabel:t_env->stmtoption->Clabels.c_label->t_prop->t_propvalinit:t_env->varinfo->initoption->t_prop->t_propvalconst:t_env->varinfo->t_prop->t_propvalassign:t_env->stmt->lval->exp->t_prop->t_propvalreturn:t_env->stmt->expoption->t_prop->t_propvaltest:t_env->stmt->exp->t_prop->t_prop->t_propvalswitch:t_env->stmt->exp->(explist*t_prop)list->t_prop->t_propvalhas_init:t_env->boolvalloop_entry:t_prop->t_propvalloop_step:t_prop->t_prop(* -------------------------------------------------------------------------- *)(* --- Call Rules --- *)(* -------------------------------------------------------------------------- *)valcall_dynamic:t_env->stmt->WpPropId.prop_id->exp->(kernel_function*t_prop)list->t_propvalcall_goal_precond:t_env->stmt->kernel_function->explist->pre:WpPropId.pred_infolist->t_prop->t_propvalcall_terminates:t_env->stmt->kind:terminates_source->?kf:kernel_function->explist->WpPropId.pred_info->callee_t:predicate->t_prop->t_propvalcall_decreases:t_env->stmt->?kf:kernel_function->explist->WpPropId.variant_info->?caller_t:predicate->?callee_d:variant->t_prop->t_propvalcall:t_env->stmt->lvaloption->kernel_function->explist->pre:WpPropId.pred_infolist->post:WpPropId.pred_infolist->pexit:WpPropId.pred_infolist->assigns:assigns->p_post:t_prop->p_exit:t_prop->t_prop(* -------------------------------------------------------------------------- *)(* --- SCOPING RULES --- *)(* -------------------------------------------------------------------------- *)valscope:t_env->varinfolist->scope->t_prop->t_propvalclose:t_env->t_prop->t_prop(* -------------------------------------------------------------------------- *)(* --- FROM --- *)(* -------------------------------------------------------------------------- *)(** build [p => alpha(p)] for functional dependencies verification. *)valbuild_prop_of_from:t_env->WpPropId.pred_infolist->t_prop->t_propend