123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145(**************************************************************************)(* *)(* 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). *)(* *)(**************************************************************************)(* ------------------------------------------------------------------------ *)(* --- Prover List in Configuration --- *)(* ------------------------------------------------------------------------ *)moduleS=Why3.Whyconf.SprovermoduleM=Why3.Whyconf.Mproverclassprovers=object(self)inherit[S.t]Wutil.selectorS.emptyinitializerbegin(* select automatically the provers set on the command line *)letcmdline=matchWp_parameters.Provers.get()with|[]->["alt-ergo"]|prvs->prvsinletselection=List.fold_left(funacce->matchWhy3Provers.find_optewith|None->acc|Somep->S.addpacc)S.emptycmdlineinself#setselection;endend(* ------------------------------------------------------------------------ *)(* --- WP Provers Configuration Panel --- *)(* ------------------------------------------------------------------------ *)classdp_chooser~(main:Design.main_window_extension_points)~(provers:provers)=letdialog=newWpane.dialog~title:"Why3 Provers"~window:main#main_window~resize:false()inletarray=newWpane.warray()inobject(self)valmutablemainstream=truevalmutableselected=M.emptymethodprivateenabledpe=selected<-M.adddpeselectedmethodprivatelookupdp=tryM.finddpselectedwithNot_found->falsemethodprivateentrydp=lettext=Why3Provers.titledpinletsw=newWidget.switch()inletlb=newWidget.label~align:`Left~text()insw#set(self#lookupdp);sw#connect(self#enabledp);lethbox=GPack.hbox~spacing:10~homogeneous:false()inhbox#pack~expand:falsesw#coerce;hbox#pack~expand:truelb#coerce;(objectmethodwidget=hbox#coercemethodupdate()=sw#set(self#lookupdp)methoddelete()=()end)methodprivateconfiguredps=beginarray#set(Why3.Whyconf.Sprover.elementsdps);array#update();endmethodprivateprovers=letfilterp=self#lookupp||notmainstream||Why3Provers.is_mainstreampinS.filterfilter(Why3Provers.provers_set())methodprivatefilter()=beginmainstream<-notmainstream;self#configureself#provers;endmethodprivateapply()=provers#set(M.map_filter(function|true->Some()|false->None)selected)methodrun()=selected<-M.empty;letdps=self#proversinletsel=provers#getinselected<-M.merge(fun_availenab->matchavail,enabwith|None,_->None|Some(),Some()->Sometrue|Some(),None->Somefalse)dpssel;self#configuredps;dialog#run()initializerbegindialog#button~action:(`ACTIONself#filter)~label:"Filter"~tooltip:"Switch to main stream / alternative solvers"();dialog#button~action:(`CANCEL)~label:"Cancel"();dialog#button~action:(`APPLY)~label:"Apply"();array#set_entryself#entry;dialog#add_blockarray#coerce;dialog#on_value`APPLYself#apply;endend(* ------------------------------------------------------------------------ *)