diff --git a/Cargo.lock b/Cargo.lock index a2071cd7f9..e98ed99ec5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -202,7 +202,6 @@ version = "0.2.0" dependencies = [ "arraydeque", "assert_cmd", - "cargo-creusot", "clap", "creusot-contracts", "creusot-metadata", @@ -729,9 +728,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] diff --git a/cargo-creusot/src/bin/creusot-rustc.rs b/cargo-creusot/src/bin/creusot-rustc.rs index 9ef71d81cb..af37fa2a03 100644 --- a/cargo-creusot/src/bin/creusot-rustc.rs +++ b/cargo-creusot/src/bin/creusot-rustc.rs @@ -4,6 +4,7 @@ extern crate lazy_static; extern crate rustc_driver; extern crate rustc_errors; extern crate rustc_interface; +extern crate rustc_session; #[macro_use] extern crate log; @@ -14,6 +15,7 @@ use creusot::callbacks::*; use rustc_driver::{RunCompiler, DEFAULT_LOCALE_RESOURCES}; use rustc_errors::{emitter::EmitterWriter, TerminalUrl}; use rustc_interface::interface::try_print_query_stack; +use rustc_session::{config::ErrorOutputType, EarlyErrorHandler}; use std::{env, panic, panic::PanicInfo, process::Command}; const BUG_REPORT_URL: &'static str = &"https://github.com/xldenis/creusot/issues/new"; @@ -67,7 +69,8 @@ struct DefaultCallbacks; impl rustc_driver::Callbacks for DefaultCallbacks {} fn main() { - rustc_driver::init_rustc_env_logger(); + let handler = EarlyErrorHandler::new(ErrorOutputType::default()); + rustc_driver::init_rustc_env_logger(&handler); env_logger::init(); lazy_static::initialize(&ICE_HOOK); diff --git a/ci/rust-toolchain b/ci/rust-toolchain index 48005cc8f4..45a14b25a3 100644 --- a/ci/rust-toolchain +++ b/ci/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2023-05-26" -components = [ "rustfmt", "rustc-dev", "llvm-tools-preview" ] +channel = "nightly-2023-06-29" +components = [ "rustfmt", "rustc-dev", "llvm-tools" ] diff --git a/creusot-contracts-proc/src/invariant.rs b/creusot-contracts-proc/src/invariant.rs index 8b034864fb..d81df937f0 100644 --- a/creusot-contracts-proc/src/invariant.rs +++ b/creusot-contracts-proc/src/invariant.rs @@ -56,7 +56,7 @@ pub struct Loop { fn filter_invariants(attrs: &mut Vec) -> Vec { attrs - .drain_filter(|attr| attr.path().get_ident().map(|i| i == "invariant").unwrap_or(false)) + .extract_if(|attr| attr.path().get_ident().map(|i| i == "invariant").unwrap_or(false)) .collect() } diff --git a/creusot-contracts-proc/src/lib.rs b/creusot-contracts-proc/src/lib.rs index 98a3138874..3c8eb39400 100644 --- a/creusot-contracts-proc/src/lib.rs +++ b/creusot-contracts-proc/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(box_patterns, drain_filter, extend_one, proc_macro_def_site)] +#![feature(box_patterns, extract_if, extend_one, proc_macro_def_site)] extern crate proc_macro; use extern_spec::ExternSpecs; use pearlite_syn::*; diff --git a/creusot/Cargo.toml b/creusot/Cargo.toml index 664582d1cc..b19ac556dd 100644 --- a/creusot/Cargo.toml +++ b/creusot/Cargo.toml @@ -24,7 +24,6 @@ similar = "2.2" termcolor = "1.1" arraydeque = "0.4" creusot-contracts = { path = "../creusot-contracts", features = ["typechecker"] } -cargo-creusot = { path = "../cargo-creusot" } escargot = { version = "0.5" } [[test]] name = "ui" diff --git a/creusot/src/analysis.rs b/creusot/src/analysis.rs index 80f02e2f32..54948199ee 100644 --- a/creusot/src/analysis.rs +++ b/creusot/src/analysis.rs @@ -111,7 +111,6 @@ pub(crate) fn categorize(context: PlaceContext) -> Option { PlaceContext::MutatingUse(MutatingUseContext::Borrow) | PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow) | PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow) | - PlaceContext::NonMutatingUse(NonMutatingUseContext::UniqueBorrow) | PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | PlaceContext::MutatingUse(MutatingUseContext::AddressOf) | PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) | diff --git a/creusot/src/analysis/frozen_locals.rs b/creusot/src/analysis/frozen_locals.rs index 076dd73d5e..14aed01404 100644 --- a/creusot/src/analysis/frozen_locals.rs +++ b/creusot/src/analysis/frozen_locals.rs @@ -121,7 +121,7 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> { type Idx = BorrowIndex; fn before_statement_effect( - &self, + &mut self, _trans: &mut impl GenKill, _statement: &mir::Statement<'tcx>, _location: Location, @@ -129,7 +129,7 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> { } fn statement_effect( - &self, + &mut self, trans: &mut impl GenKill, stmt: &mir::Statement<'tcx>, location: Location, @@ -184,7 +184,7 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> { } fn before_terminator_effect( - &self, + &mut self, _trans: &mut impl GenKill, _terminator: &mir::Terminator<'tcx>, _location: Location, @@ -192,7 +192,7 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> { } fn terminator_effect( - &self, + &mut self, trans: &mut impl GenKill, terminator: &mir::Terminator<'tcx>, location: Location, @@ -211,7 +211,7 @@ impl<'tcx> dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> { } fn call_return_effect( - &self, + &mut self, _trans: &mut impl GenKill, _block: mir::BasicBlock, _return_places: dataflow::CallReturnPlaces<'_, 'tcx>, diff --git a/creusot/src/analysis/init_locals.rs b/creusot/src/analysis/init_locals.rs index e0d7618322..8f79b4733d 100644 --- a/creusot/src/analysis/init_locals.rs +++ b/creusot/src/analysis/init_locals.rs @@ -34,7 +34,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals { type Idx = Local; fn statement_effect( - &self, + &mut self, trans: &mut impl GenKill, statement: &mir::Statement<'tcx>, loc: Location, @@ -43,7 +43,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals { } fn terminator_effect( - &self, + &mut self, trans: &mut impl GenKill, terminator: &Terminator<'tcx>, loc: Location, @@ -52,7 +52,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals { } fn call_return_effect( - &self, + &mut self, trans: &mut impl GenKill, _block: BasicBlock, return_places: dataflow::CallReturnPlaces<'_, 'tcx>, @@ -62,7 +62,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals { /// See `Analysis::apply_yield_resume_effect`. fn yield_resume_effect( - &self, + &mut self, trans: &mut impl GenKill, _resume_block: BasicBlock, resume_place: mir::Place<'tcx>, @@ -114,7 +114,6 @@ where | NonMutatingUseContext::Copy | NonMutatingUseContext::SharedBorrow | NonMutatingUseContext::ShallowBorrow - | NonMutatingUseContext::UniqueBorrow | NonMutatingUseContext::AddressOf | NonMutatingUseContext::PlaceMention | NonMutatingUseContext::Projection, diff --git a/creusot/src/analysis/liveness_no_drop.rs b/creusot/src/analysis/liveness_no_drop.rs index a8806e159d..e7544ddaa1 100644 --- a/creusot/src/analysis/liveness_no_drop.rs +++ b/creusot/src/analysis/liveness_no_drop.rs @@ -35,7 +35,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop { type Idx = Local; fn statement_effect( - &self, + &mut self, trans: &mut impl GenKill, statement: &mir::Statement<'tcx>, location: Location, @@ -44,7 +44,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop { } fn terminator_effect( - &self, + &mut self, trans: &mut impl GenKill, terminator: &mir::Terminator<'tcx>, location: Location, @@ -53,7 +53,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop { } fn call_return_effect( - &self, + &mut self, trans: &mut impl GenKill, _block: mir::BasicBlock, return_places: CallReturnPlaces<'_, 'tcx>, @@ -66,7 +66,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveExceptDrop { } fn yield_resume_effect( - &self, + &mut self, trans: &mut impl GenKill, _resume_block: mir::BasicBlock, resume_place: mir::Place<'tcx>, @@ -196,8 +196,7 @@ impl DefUse { | NonMutatingUseContext::Move | NonMutatingUseContext::ShallowBorrow | NonMutatingUseContext::SharedBorrow - | NonMutatingUseContext::PlaceMention - | NonMutatingUseContext::UniqueBorrow, + | NonMutatingUseContext::PlaceMention, ) => Some(DefUse::Use), PlaceContext::MutatingUse(MutatingUseContext::Drop) => None, diff --git a/creusot/src/analysis/uninit_locals.rs b/creusot/src/analysis/uninit_locals.rs index 02b6a462a2..89b3a4dcb1 100644 --- a/creusot/src/analysis/uninit_locals.rs +++ b/creusot/src/analysis/uninit_locals.rs @@ -35,7 +35,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals { type Idx = Local; fn statement_effect( - &self, + &mut self, trans: &mut impl GenKill, statement: &mir::Statement<'tcx>, loc: Location, @@ -44,7 +44,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals { } fn terminator_effect( - &self, + &mut self, trans: &mut impl GenKill, terminator: &Terminator<'tcx>, loc: Location, @@ -53,7 +53,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals { } fn call_return_effect( - &self, + &mut self, trans: &mut impl GenKill, _block: BasicBlock, return_places: dataflow::CallReturnPlaces<'_, 'tcx>, @@ -67,7 +67,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedLocals { /// See `Analysis::apply_yield_resume_effect`. fn yield_resume_effect( - &self, + &mut self, trans: &mut impl GenKill, _resume_block: BasicBlock, resume_place: mir::Place<'tcx>, @@ -112,7 +112,6 @@ where | NonMutatingUseContext::Copy | NonMutatingUseContext::SharedBorrow | NonMutatingUseContext::ShallowBorrow - | NonMutatingUseContext::UniqueBorrow | NonMutatingUseContext::AddressOf | NonMutatingUseContext::PlaceMention | NonMutatingUseContext::Projection, diff --git a/creusot/src/backend/dependency.rs b/creusot/src/backend/dependency.rs index 6b1165bd30..046966ca26 100644 --- a/creusot/src/backend/dependency.rs +++ b/creusot/src/backend/dependency.rs @@ -109,9 +109,9 @@ impl<'tcx> Dependency<'tcx> { }; match &mut self { - Dependency::Item(_, s) => *s = EarlyBinder(*s).subst(tcx, substs), + Dependency::Item(_, s) => *s = EarlyBinder::bind(*s).subst(tcx, substs), Dependency::Type(ty) | Dependency::TyInv(ty) => { - *ty = EarlyBinder(*ty).subst(tcx, substs) + *ty = EarlyBinder::bind(*ty).subst(tcx, substs) } }; self diff --git a/creusot/src/backend/term.rs b/creusot/src/backend/term.rs index 25f88d067a..c2b389395d 100644 --- a/creusot/src/backend/term.rs +++ b/creusot/src/backend/term.rs @@ -414,7 +414,7 @@ pub(super) fn mk_binders(func: Exp, args: Vec) -> Exp { fn is_identity_from<'tcx>(tcx: TyCtxt<'tcx>, id: DefId, subst: SubstsRef<'tcx>) -> bool { if tcx.def_path_str(id) == "std::convert::From::from" && subst.len() == 1 { let out_ty: Ty<'tcx> = tcx.fn_sig(id).no_bound_vars().unwrap().output().skip_binder(); - return subst[0].expect_ty() == EarlyBinder(out_ty).subst(tcx, subst); + return subst[0].expect_ty() == EarlyBinder::bind(out_ty).subst(tcx, subst); } false } diff --git a/creusot/src/ctx.rs b/creusot/src/ctx.rs index 9977ac232b..ac5da2eb3c 100644 --- a/creusot/src/ctx.rs +++ b/creusot/src/ctx.rs @@ -29,7 +29,10 @@ use rustc_infer::traits::{Obligation, ObligationCause}; use rustc_middle::{ mir::{Body, Promoted}, thir, - ty::{subst::InternalSubsts, GenericArg, ParamEnv, SubstsRef, Ty, TyCtxt, Visibility}, + ty::{ + subst::InternalSubsts, Clause, GenericArg, ParamEnv, Predicate, SubstsRef, Ty, TyCtxt, + Visibility, + }, }; use rustc_span::{RealFileName, Span, Symbol, DUMMY_SP}; use rustc_trait_selection::traits::SelectionContext; @@ -222,25 +225,33 @@ impl<'tcx, 'sess> TranslationCtx<'tcx> { } pub(crate) fn crash_and_error(&self, span: Span, msg: &str) -> ! { - self.tcx.sess.span_fatal_with_code(span, msg, DiagnosticId::Error(String::from("creusot"))) + self.tcx.sess.span_fatal_with_code( + span, + msg.to_string(), + DiagnosticId::Error(String::from("creusot")), + ) } pub(crate) fn fatal_error(&self, span: Span, msg: &str) -> DiagnosticBuilder<'tcx, !> { self.tcx.sess.struct_span_fatal_with_code( span, - msg, + msg.to_string(), DiagnosticId::Error(String::from("creusot")), ) } pub(crate) fn error(&self, span: Span, msg: &str) { - self.tcx.sess.span_err_with_code(span, msg, DiagnosticId::Error(String::from("creusot"))) + self.tcx.sess.span_err_with_code( + span, + msg.to_string(), + DiagnosticId::Error(String::from("creusot")), + ) } pub(crate) fn warn(&self, span: Span, msg: &str) { self.tcx.sess.span_warn_with_code( span, - msg, + msg.to_string(), DiagnosticId::Lint { name: String::from("creusot"), has_future_breakage: false, @@ -343,7 +354,10 @@ impl<'tcx, 'sess> TranslationCtx<'tcx> { for pred in es.predicates_for(self.tcx, subst) { let obligation_cause = ObligationCause::dummy(); let obligation = Obligation::new(self.tcx, obligation_cause, param_env, pred); - if !selcx.predicate_may_hold_fatal(&obligation) { + if selcx.evaluate_root_obligation(&obligation).map_or( + false, // Overflow has occurred, and treat the obligation as possibly holding. + |result| !result.may_apply(), + ) { additional_predicates.push( self.tcx.try_normalize_erasing_regions(base_env, pred).unwrap_or(pred), ) @@ -351,9 +365,17 @@ impl<'tcx, 'sess> TranslationCtx<'tcx> { } } - additional_predicates.extend(base_env.caller_bounds()); + additional_predicates.extend::>( + base_env.caller_bounds().into_iter().map(Clause::as_predicate).collect(), + ); ParamEnv::new( - self.mk_predicates(&additional_predicates), + self.mk_clauses( + &(additional_predicates + .into_iter() + .map(Predicate::expect_clause) + .collect::>() + .as_slice()), + ), rustc_infer::traits::Reveal::UserFacing, rustc_hir::Constness::NotConst, ) diff --git a/creusot/src/extended_location.rs b/creusot/src/extended_location.rs index 4928aac7b8..cfff054da4 100644 --- a/creusot/src/extended_location.rs +++ b/creusot/src/extended_location.rs @@ -1,5 +1,5 @@ use rustc_middle::mir::Location; -use rustc_mir_dataflow::{self as dataflow, Analysis, Results, ResultsCursor}; +use rustc_mir_dataflow::{self as dataflow, Analysis, AnalysisResults, Results, ResultsCursor}; use std::borrow::Borrow; // Dataflow locations @@ -39,6 +39,7 @@ impl ExtendedLocation { where A: Analysis<'tcx, Direction = D>, D: Dir, + R: AnalysisResults<'tcx, A>, R: Borrow>, { use ExtendedLocation::*; diff --git a/creusot/src/lib.rs b/creusot/src/lib.rs index 707c90b5ea..f68eaaf7ba 100644 --- a/creusot/src/lib.rs +++ b/creusot/src/lib.rs @@ -1,5 +1,5 @@ #![feature(rustc_private, register_tool)] -#![feature(box_patterns, control_flow_enum, drain_filter)] +#![feature(box_patterns, control_flow_enum, extract_if)] #![feature(let_chains, never_type, try_blocks)] #[macro_use] diff --git a/creusot/src/translation/external.rs b/creusot/src/translation/external.rs index 236152bc12..9b7d987b70 100644 --- a/creusot/src/translation/external.rs +++ b/creusot/src/translation/external.rs @@ -10,7 +10,7 @@ use rustc_middle::{ thir::{self, visit::Visitor, Expr, ExprKind, Thir}, ty::{ subst::{GenericArgKind, InternalSubsts, SubstsRef}, - EarlyBinder, Predicate, TyCtxt, TyKind, + Clause, EarlyBinder, Predicate, TyCtxt, TyKind, }, }; use rustc_span::Symbol; @@ -31,7 +31,7 @@ impl<'tcx> ExternSpec<'tcx> { tcx: TyCtxt<'tcx>, sub: SubstsRef<'tcx>, ) -> Vec> { - EarlyBinder(self.additional_predicates.clone()).subst(tcx, sub) + EarlyBinder::bind(self.additional_predicates.clone()).subst(tcx, sub) } } @@ -131,8 +131,13 @@ pub(crate) fn extract_extern_specs_from_item<'tcx>( let contract = crate::specification::contract_clauses_of(ctx, def_id.to_def_id()).unwrap(); - let additional_predicates = - ctx.predicates_of(def_id).instantiate(ctx.tcx, subst).predicates.into_iter().collect(); + let additional_predicates = ctx + .predicates_of(def_id) + .instantiate(ctx.tcx, subst) + .predicates + .into_iter() + .map(Clause::as_predicate) + .collect(); let arg_subst = ctx .fn_arg_names(def_id) diff --git a/creusot/src/translation/function.rs b/creusot/src/translation/function.rs index bf47f5b84d..2a90220f1e 100644 --- a/creusot/src/translation/function.rs +++ b/creusot/src/translation/function.rs @@ -548,7 +548,7 @@ pub(crate) fn closure_contract<'tcx>( normalize(ctx.tcx, ctx.param_env(def_id), &mut postcondition); - let unnest_sig = EarlyBinder(ctx.sig(unnest_id).clone()).subst(ctx.tcx, unnest_subst); + let unnest_sig = EarlyBinder::bind(ctx.sig(unnest_id).clone()).subst(ctx.tcx, unnest_subst); let mut unnest = closure_unnest(ctx.tcx, def_id, subst); normalize(ctx.tcx, ctx.param_env(def_id), &mut unnest); diff --git a/creusot/src/translation/function/statement.rs b/creusot/src/translation/function/statement.rs index 45e8ffbd2e..4b80eb6db7 100644 --- a/creusot/src/translation/function/statement.rs +++ b/creusot/src/translation/function/statement.rs @@ -75,7 +75,7 @@ impl<'tcx> BodyTranslator<'_, 'tcx> { } }, Rvalue::Ref(_, ss, pl) => match ss { - Shared | Shallow | Unique => { + Shared | Shallow => { if self.erased_locals.contains(pl.local) { return; } diff --git a/creusot/src/translation/function/terminator.rs b/creusot/src/translation/function/terminator.rs index 1244df94fd..3b9af0f756 100644 --- a/creusot/src/translation/function/terminator.rs +++ b/creusot/src/translation/function/terminator.rs @@ -230,7 +230,7 @@ pub(crate) fn evaluate_additional_predicates<'tcx>( param_env: ParamEnv<'tcx>, sp: Span, ) -> Result<(), Vec>> { - let mut fulfill_cx = >::new(infcx.tcx); + let mut fulfill_cx = >::new(infcx); for predicate in p { let predicate = infcx.tcx.erase_regions(predicate); let cause = ObligationCause::dummy_with_span(sp); diff --git a/creusot/src/translation/pearlite.rs b/creusot/src/translation/pearlite.rs index 2dc2ddc819..84317d07c7 100644 --- a/creusot/src/translation/pearlite.rs +++ b/creusot/src/translation/pearlite.rs @@ -289,9 +289,9 @@ impl<'a, 'tcx> ThirTerm<'a, 'tcx> { use rustc_middle::mir; let op = match op { - mir::BinOp::Add => BinOp::Add, - mir::BinOp::Sub => BinOp::Sub, - mir::BinOp::Mul => BinOp::Mul, + mir::BinOp::Add | mir::BinOp::AddUnchecked => BinOp::Add, + mir::BinOp::Sub | mir::BinOp::SubUnchecked => BinOp::Sub, + mir::BinOp::Mul | mir::BinOp::MulUnchecked => BinOp::Mul, mir::BinOp::Div => BinOp::Div, mir::BinOp::Rem => BinOp::Rem, mir::BinOp::BitXor => { @@ -303,10 +303,10 @@ impl<'a, 'tcx> ThirTerm<'a, 'tcx> { mir::BinOp::BitOr => { return Err(Error::new(self.thir[expr].span, "unsupported operation")) } - mir::BinOp::Shl => { + mir::BinOp::Shl | mir::BinOp::ShlUnchecked => { return Err(Error::new(self.thir[expr].span, "unsupported operation")) } - mir::BinOp::Shr => { + mir::BinOp::Shr | mir::BinOp::ShrUnchecked => { return Err(Error::new(self.thir[expr].span, "unsupported operation")) } mir::BinOp::Lt => BinOp::Lt, diff --git a/creusot/src/translation/specification.rs b/creusot/src/translation/specification.rs index 73c8463327..40a84e3c04 100644 --- a/creusot/src/translation/specification.rs +++ b/creusot/src/translation/specification.rs @@ -103,7 +103,7 @@ impl ContractClauses { let term = ctx.term(var_id).unwrap().clone(); out.variant = Some(term); }; - EarlyBinder(out) + EarlyBinder::bind(out) } pub(crate) fn iter_ids(&self) -> impl Iterator + '_ { diff --git a/creusot/src/translation/traits.rs b/creusot/src/translation/traits.rs index ef83a23063..147577f03a 100644 --- a/creusot/src/translation/traits.rs +++ b/creusot/src/translation/traits.rs @@ -77,7 +77,7 @@ impl<'tcx> TranslationCtx<'tcx> { let subst = InternalSubsts::identity_for_item(self.tcx, impl_item); - let refn_subst = subst.rebase_onto(self.tcx, impl_id, trait_ref.0.substs); + let refn_subst = subst.rebase_onto(self.tcx, impl_id, trait_ref.skip_binder().substs); // TODO: Clean up and abstract let predicates = self @@ -121,7 +121,7 @@ fn logic_refinement_term<'tcx>( let trait_sig = { let pre_sig = ctx.sig(trait_item_id).clone(); let param_env = ctx.param_env(impl_item_id); - EarlyBinder(pre_sig).subst(ctx.tcx, refn_subst).normalize(ctx.tcx, param_env) + EarlyBinder::bind(pre_sig).subst(ctx.tcx, refn_subst).normalize(ctx.tcx, param_env) }; let impl_sig = ctx.sig(impl_item_id).clone(); @@ -305,7 +305,12 @@ pub(crate) fn resolve_assoc_item_opt<'tcx>( Some((leaf_def.item.def_id, leaf_substs)) } ImplSource::Param(_, _) => Some((def_id, substs)), - ImplSource::Closure(impl_data) => Some((impl_data.closure_def_id, impl_data.substs)), + ImplSource::Builtin(_) => match *substs.type_at(0).kind() { + rustc_middle::ty::Closure(closure_def_id, closure_substs) => { + Some((closure_def_id, closure_substs)) + } + _ => unimplemented!(), + }, _ => unimplemented!(), } } @@ -335,7 +340,7 @@ pub(crate) fn still_specializable<'tcx>( let trait_generics = substs.truncate_to(tcx, tcx.generics_of(trait_id)); !is_final && trait_generics.still_further_specializable() } else if let Some(impl_id) = tcx.impl_of_method(def_id) && tcx.trait_id_of_impl(impl_id).is_some() { - let is_final = tcx.impl_defaultness(def_id).is_final(); + let is_final = tcx.defaultness(def_id).is_final(); let trait_ref = tcx.impl_trait_ref(impl_id).unwrap(); !is_final && trait_ref.subst(tcx, substs).still_further_specializable() } else { diff --git a/creusot/src/util.rs b/creusot/src/util.rs index 3ee51c7bcf..270a2659a7 100644 --- a/creusot/src/util.rs +++ b/creusot/src/util.rs @@ -500,7 +500,7 @@ fn elaborate_type_invariants<'tcx>( } if let Some(term) = pearlite::type_invariant_term(ctx, def_id, *name, *span, *ty) { - let term = EarlyBinder(term).subst(ctx.tcx, subst); + let term = EarlyBinder::bind(term).subst(ctx.tcx, subst); if ty.is_mutable_ptr() { let inner = ty.builtin_deref(true).unwrap().ty; @@ -525,7 +525,7 @@ fn elaborate_type_invariants<'tcx>( ret_ty_span.unwrap_or_else(|| ctx.tcx.def_span(def_id)), pre_sig.output, ) { - let term = EarlyBinder(term).subst(ctx.tcx, subst); + let term = EarlyBinder::bind(term).subst(ctx.tcx, subst); pre_sig.contract.ensures.push(term); } } diff --git a/creusot/src/validate.rs b/creusot/src/validate.rs index 35c2ec5fed..e01c00e888 100644 --- a/creusot/src/validate.rs +++ b/creusot/src/validate.rs @@ -103,7 +103,7 @@ pub(crate) fn validate_impls(ctx: &TranslationCtx) { continue; } - let trait_ref = ctx.impl_trait_ref(*impl_id).unwrap().0; + let trait_ref = ctx.impl_trait_ref(*impl_id).unwrap().skip_binder(); if util::is_trusted(ctx.tcx, trait_ref.def_id) != util::is_trusted(ctx.tcx, impl_id.to_def_id()) diff --git a/creusot/tests/should_fail/cycle.stderr b/creusot/tests/should_fail/cycle.stderr index bb5442039e..35765a8e98 100644 --- a/creusot/tests/should_fail/cycle.stderr +++ b/creusot/tests/should_fail/cycle.stderr @@ -6,7 +6,7 @@ warning: unused import: `creusot_contracts::*` | = note: `#[warn(unused_imports)]` on by default -error[creusot]: encountered a cycle during translation: [{Item(DefId(0:5 ~ cycle[c4ca]::f))}, {Item(DefId(0:6 ~ cycle[c4ca]::g))}, {Item(DefId(0:5 ~ cycle[c4ca]::f))}] +error[creusot]: encountered a cycle during translation: [{Item(DefId(0:5 ~ cycle[08f3]::f))}, {Item(DefId(0:6 ~ cycle[08f3]::g))}, {Item(DefId(0:5 ~ cycle[08f3]::f))}] --> cycle.rs:4:1 | 4 | pub fn f() { diff --git a/creusot/tests/should_succeed/100doors.mlcfg b/creusot/tests/should_succeed/100doors.mlcfg index 98fb31be9f..cca33f3180 100644 --- a/creusot/tests/should_succeed/100doors.mlcfg +++ b/creusot/tests/should_succeed/100doors.mlcfg @@ -200,6 +200,17 @@ module CreusotContracts_Resolve_Impl1_Resolve ensures { result = resolve self } end +module Core_Option_Option_Type + type t_option 't = + | C_None + | C_Some 't + + let function some_0 (self : t_option 't) : 't = [@vc:do_not_keep_trace] [@vc:sp] + match (self) with + | C_None -> any 't + | C_Some a -> a + end +end module Alloc_Alloc_Global_Type type t_global = | C_Global @@ -319,17 +330,6 @@ module CreusotContracts_Std1_Vec_Impl10_Resolve ensures { result = resolve self } end -module Core_Option_Option_Type - type t_option 't = - | C_None - | C_Some 't - - let function some_0 (self : t_option 't) : 't = [@vc:do_not_keep_trace] [@vc:sp] - match (self) with - | C_None -> any 't - | C_Some a -> a - end -end module Alloc_Vec_FromElem_Interface type t use seq.Seq @@ -594,7 +594,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -684,7 +684,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -895,25 +895,6 @@ module CreusotContracts_Std1_Iter_Range_Impl0_Completed val completed (self : borrowed (Core_Ops_Range_Range_Type.t_range idx)) : bool ensures { result = completed self } -end -module CreusotContracts_Resolve_Impl2_Resolve_Stub - type t - predicate resolve (self : t) -end -module CreusotContracts_Resolve_Impl2_Resolve_Interface - type t - predicate resolve (self : t) - val resolve (self : t) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Resolve_Impl2_Resolve - type t - predicate resolve (self : t) = - [#"../../../../creusot-contracts/src/resolve.rs" 36 8 36 12] true - val resolve (self : t) : bool - ensures { result = resolve self } - end module CreusotContracts_Std1_Slice_Impl5_InBounds_Stub type t @@ -998,6 +979,25 @@ module CreusotContracts_Std1_Slice_Impl5_ResolveElswhere val resolve_elswhere [@inline:trivial] (self : usize) (old' : Seq.seq t) (fin : Seq.seq t) : bool ensures { result = resolve_elswhere self old' fin } +end +module CreusotContracts_Resolve_Impl2_Resolve_Stub + type t + predicate resolve (self : t) +end +module CreusotContracts_Resolve_Impl2_Resolve_Interface + type t + predicate resolve (self : t) + val resolve (self : t) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Resolve_Impl2_Resolve + type t + predicate resolve (self : t) = + [#"../../../../creusot-contracts/src/resolve.rs" 36 8 36 12] true + val resolve (self : t) : bool + ensures { result = resolve self } + end module TyInv_Trivial type t @@ -1020,6 +1020,8 @@ module C100doors_F type t = usize, predicate Inv0.inv = Inv1.inv, axiom . + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve3 with + type t = bool clone CreusotContracts_Std1_Slice_Impl5_ResolveElswhere as ResolveElswhere0 with type t = bool use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type @@ -1043,8 +1045,6 @@ module C100doors_F type t = Alloc_Vec_Vec_Type.t_vec bool (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq bool, function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve3 with - type t = bool use prelude.Int clone CreusotContracts_Std1_Num_Impl16_DeepModel as DeepModel0 use Core_Ops_Range_Range_Type as Core_Ops_Range_Range_Type @@ -1080,9 +1080,15 @@ module C100doors_F type t = bool, type s = Alloc_Vec_Vec_Type.t_vec bool (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve2 with + type t = bool, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve3.resolve, + val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = bool - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = bool, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1093,7 +1099,7 @@ module C100doors_F predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere0.resolve_elswhere, type Output0.output = bool, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = bool, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1101,12 +1107,6 @@ module C100doors_F predicate InBounds0.in_bounds = InBounds0.in_bounds, predicate HasValue0.has_value = HasValue0.has_value, type Output0.output = bool - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve1 with - type t = bool, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve3.resolve, - val Max0.mAX' = Max0.mAX' use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Iter_Range_Impl3_Next_Interface as Next0 with type a = usize, @@ -1189,7 +1189,7 @@ module C100doors_F end } BB9 { - assume { Resolve1.resolve door_open }; + assume { Resolve2.resolve door_open }; _0 <- (); goto BB21 } @@ -1197,7 +1197,7 @@ module C100doors_F goto BB12 } BB11 { - assume { Resolve1.resolve door_open }; + assume { Resolve2.resolve door_open }; absurd } BB12 { @@ -1239,7 +1239,7 @@ module C100doors_F } BB19 { _30 <- { _30 with current = (not _26) }; - assume { Resolve2.resolve _30 }; + assume { Resolve1.resolve _30 }; door <- ([#"../100doors.rs" 27 12 27 24] door + pass); _11 <- (); goto BB15 diff --git a/creusot/tests/should_succeed/100doors/why3shapes.gz b/creusot/tests/should_succeed/100doors/why3shapes.gz index 3081ee1712..927c1c6286 100644 Binary files a/creusot/tests/should_succeed/100doors/why3shapes.gz and b/creusot/tests/should_succeed/100doors/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/all_zero.mlcfg b/creusot/tests/should_succeed/all_zero.mlcfg index f67c51f3da..68092d5472 100644 --- a/creusot/tests/should_succeed/all_zero.mlcfg +++ b/creusot/tests/should_succeed/all_zero.mlcfg @@ -127,9 +127,9 @@ module AllZero_AllZero clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = AllZero_List_Type.t_list clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = uint32 - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = AllZero_List_Type.t_list + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = uint32 use Core_Option_Option_Type as Core_Option_Option_Type clone AllZero_Impl0_Get as Get0 clone AllZero_Impl0_Len as Len0 @@ -177,17 +177,17 @@ module AllZero_AllZero next <- borrow_mut (AllZero_List_Type.cons_1 ( * loop_l)); loop_l <- { loop_l with current = (let AllZero_List_Type.C_Cons a b = * loop_l in AllZero_List_Type.C_Cons a ( ^ next)) }; value <- { value with current = ([#"../all_zero.rs" 44 17 44 18] (0 : uint32)) }; - assume { Resolve1.resolve value }; + assume { Resolve0.resolve value }; _13 <- borrow_mut ( * next); next <- { next with current = ( ^ _13) }; - assume { Resolve0.resolve loop_l }; + assume { Resolve1.resolve loop_l }; loop_l <- _13; _13 <- any borrowed (AllZero_List_Type.t_list); assume { Resolve2.resolve next }; goto BB2 } BB6 { - assume { Resolve0.resolve loop_l }; + assume { Resolve1.resolve loop_l }; _0 <- (); return _0 } diff --git a/creusot/tests/should_succeed/all_zero/why3session.xml b/creusot/tests/should_succeed/all_zero/why3session.xml index a8bbca72b9..e8aacddeca 100644 --- a/creusot/tests/should_succeed/all_zero/why3session.xml +++ b/creusot/tests/should_succeed/all_zero/why3session.xml @@ -7,7 +7,7 @@ - + diff --git a/creusot/tests/should_succeed/all_zero/why3shapes.gz b/creusot/tests/should_succeed/all_zero/why3shapes.gz index 20b3e0bbd0..7e21fe9086 100644 Binary files a/creusot/tests/should_succeed/all_zero/why3shapes.gz and b/creusot/tests/should_succeed/all_zero/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/bdd.mlcfg b/creusot/tests/should_succeed/bdd.mlcfg index 9f24c9068d..de839de7d7 100644 --- a/creusot/tests/should_succeed/bdd.mlcfg +++ b/creusot/tests/should_succeed/bdd.mlcfg @@ -2527,8 +2527,8 @@ module Bdd_Impl10_Hashcons type t = Bdd_Hashmap_MyHashMap_Type.t_myhashmap (Bdd_Node_Type.t_node) (Bdd_Bdd_Type.t_bdd), type ShallowModelTy0.shallowModelTy = Map.map (Bdd_NodeLog_Type.t_nodelog) (Core_Option_Option_Type.t_option (Bdd_Bdd_Type.t_bdd)), function ShallowModel0.shallow_model = ShallowModel3.shallow_model - clone Bdd_Impl3_DeepModel as DeepModel1 use Bdd_Bumpalo_Bump_Type as Bdd_Bumpalo_Bump_Type + clone Bdd_Impl3_DeepModel as DeepModel1 clone CreusotContracts_Model_Impl4_DeepModel as DeepModel0 with type t = Bdd_Node_Type.t_node, type DeepModelTy0.deepModelTy = Bdd_NodeLog_Type.t_nodelog, @@ -2561,8 +2561,6 @@ module Bdd_Impl10_Hashcons function Leastvar0.leastvar = Leastvar0.leastvar, function ShallowModel2.shallow_model = ShallowModel5.shallow_model, function ShallowModel3.shallow_model = ShallowModel6.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = Bdd_Context_Type.t_context clone Bdd_Hashmap_Impl1_Add_Interface as Add0 with type k = Bdd_Node_Type.t_node, type v = Bdd_Bdd_Type.t_bdd, @@ -2570,10 +2568,12 @@ module Bdd_Impl10_Hashcons function ShallowModel0.shallow_model = ShallowModel3.shallow_model, function DeepModel0.deep_model = DeepModel1.deep_model, function ShallowModel1.shallow_model = ShallowModel4.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = Bdd_Node_Type.t_node clone Bdd_Bumpalo_Impl0_Alloc_Interface as Alloc0 with type t = Bdd_Node_Type.t_node + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = Bdd_Context_Type.t_context clone Bdd_Hashmap_Impl1_Get_Interface as Get0 with type k = Bdd_Node_Type.t_node, type v = Bdd_Bdd_Type.t_bdd, @@ -2619,7 +2619,7 @@ module Bdd_Impl10_Hashcons } BB3 { r <- Core_Option_Option_Type.some_0 _10; - assume { Resolve1.resolve self }; + assume { Resolve0.resolve self }; assert { [@expl:assertion] [#"../bdd.rs" 444 28 444 38] ShallowModel0.shallow_model (Bdd_Bdd_Type.bdd_0 r) = ShallowModel1.shallow_model n }; _0 <- r; goto BB12 @@ -2630,7 +2630,7 @@ module Bdd_Impl10_Hashcons } BB5 { r1 <- Bdd_Bdd_Type.C_Bdd ( * _21) (Bdd_Context_Type.context_cnt ( * self)); - assume { Resolve0.resolve _21 }; + assume { Resolve1.resolve _21 }; _26 <- borrow_mut (Bdd_Context_Type.context_hashcons ( * self)); self <- { self with current = (let Bdd_Context_Type.C_Context a b c d e f = * self in Bdd_Context_Type.C_Context a ( ^ _26) c d e f) }; _25 <- ([#"../bdd.rs" 448 8 448 31] Add0.add _26 n r1); @@ -2650,7 +2650,7 @@ module Bdd_Impl10_Hashcons end } BB8 { - assume { Resolve1.resolve self }; + assume { Resolve0.resolve self }; goto BB9 } BB9 { @@ -2661,7 +2661,7 @@ module Bdd_Impl10_Hashcons } BB11 { self <- { self with current = (let Bdd_Context_Type.C_Context a b c d e f = * self in Bdd_Context_Type.C_Context a b c d e ([#"../bdd.rs" 453 8 453 21] Bdd_Context_Type.context_cnt ( * self) + ([#"../bdd.rs" 453 20 453 21] (1 : uint64)))) }; - assume { Resolve1.resolve self }; + assume { Resolve0.resolve self }; _0 <- r1; goto BB12 } @@ -2763,13 +2763,13 @@ module Bdd_Impl10_Node function Leastvar0.leastvar = Leastvar0.leastvar, function ShallowModel2.shallow_model = ShallowModel3.shallow_model, function ShallowModel3.shallow_model = ShallowModel4.shallow_model + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = Bdd_Context_Type.t_context clone Bdd_Impl10_Hashcons_Interface as Hashcons0 with predicate Invariant0.invariant' = Invariant0.invariant', predicate IsValidNode0.is_valid_node = IsValidNode0.is_valid_node, predicate Grows0.grows = Grows0.grows, predicate IsValidBdd0.is_valid_bdd = IsValidBdd0.is_valid_bdd - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with - type t = Bdd_Context_Type.t_context clone Bdd_Impl7_Eq_Interface as Eq0 with function ShallowModel0.shallow_model = ShallowModel0.shallow_model let rec cfg node [#"../bdd.rs" 466 4 466 87] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (Bdd_Context_Type.t_context)) (x : uint64) (childt : Bdd_Bdd_Type.t_bdd) (childf : Bdd_Bdd_Type.t_bdd) : Bdd_Bdd_Type.t_bdd @@ -3307,6 +3307,12 @@ module Bdd_Impl10_Not function ShallowModel0.shallow_model = ShallowModel1.shallow_model, function DeepModel0.deep_model = DeepModel1.deep_model, function ShallowModel1.shallow_model = ShallowModel2.shallow_model + clone Bdd_Impl10_Node_Interface as Node0 with + predicate Invariant0.invariant' = Invariant0.invariant', + predicate IsValidBdd0.is_valid_bdd = IsValidBdd0.is_valid_bdd, + function Leastvar0.leastvar = Leastvar0.leastvar, + predicate Grows0.grows = Grows0.grows, + function Interp0.interp = Interp0.interp clone Bdd_Impl10_True_Interface as True0 with predicate Invariant0.invariant' = Invariant0.invariant', predicate Grows0.grows = Grows0.grows, @@ -3314,12 +3320,6 @@ module Bdd_Impl10_Not function Interp0.interp = Interp0.interp, val Max0.mAX' = Max0.mAX', function Leastvar0.leastvar = Leastvar0.leastvar - clone Bdd_Impl10_Node_Interface as Node0 with - predicate Invariant0.invariant' = Invariant0.invariant', - predicate IsValidBdd0.is_valid_bdd = IsValidBdd0.is_valid_bdd, - function Leastvar0.leastvar = Leastvar0.leastvar, - predicate Grows0.grows = Grows0.grows, - function Interp0.interp = Interp0.interp clone Bdd_Impl10_False_Interface as False0 with predicate Invariant0.invariant' = Invariant0.invariant', predicate Grows0.grows = Grows0.grows, @@ -3633,29 +3633,29 @@ module Bdd_Impl10_And function ShallowModel0.shallow_model = ShallowModel1.shallow_model, function DeepModel0.deep_model = DeepModel2.deep_model, function ShallowModel1.shallow_model = ShallowModel2.shallow_model - clone Bdd_Impl10_False_Interface as False0 with - predicate Invariant0.invariant' = Invariant0.invariant', - predicate Grows0.grows = Grows0.grows, - predicate IsValidBdd0.is_valid_bdd = IsValidBdd0.is_valid_bdd, - function Interp0.interp = Interp0.interp, - val Max0.mAX' = Max0.mAX', - function Leastvar0.leastvar = Leastvar0.leastvar clone Bdd_Impl10_Node_Interface as Node0 with predicate Invariant0.invariant' = Invariant0.invariant', predicate IsValidBdd0.is_valid_bdd = IsValidBdd0.is_valid_bdd, function Leastvar0.leastvar = Leastvar0.leastvar, predicate Grows0.grows = Grows0.grows, function Interp0.interp = Interp0.interp - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = Bdd_Context_Type.t_context clone Core_Cmp_Impls_Impl63_Cmp_Interface as Cmp0 with function DeepModel0.deep_model = DeepModel1.deep_model, function CmpLog0.cmp_log = CmpLog0.cmp_log - clone CreusotContracts_Resolve_Impl0_Resolve as Resolve1 with + clone Bdd_Impl10_False_Interface as False0 with + predicate Invariant0.invariant' = Invariant0.invariant', + predicate Grows0.grows = Grows0.grows, + predicate IsValidBdd0.is_valid_bdd = IsValidBdd0.is_valid_bdd, + function Interp0.interp = Interp0.interp, + val Max0.mAX' = Max0.mAX', + function Leastvar0.leastvar = Leastvar0.leastvar + clone CreusotContracts_Resolve_Impl0_Resolve as Resolve2 with type t1 = Bdd_Node_Type.t_node, type t2 = Bdd_Node_Type.t_node, predicate Resolve0.resolve = Resolve4.resolve, predicate Resolve1.resolve = Resolve4.resolve + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = Bdd_Context_Type.t_context clone CreusotContracts_Resolve_Impl0_Resolve as Resolve0 with type t1 = Bdd_Bdd_Type.t_bdd, type t2 = Bdd_Bdd_Type.t_bdd, @@ -3732,7 +3732,7 @@ module Bdd_Impl10_And BB3 { r <- Core_Option_Option_Type.some_0 _14; _0 <- r; - assume { Resolve2.resolve self }; + assume { Resolve1.resolve self }; goto BB35 } BB4 { @@ -3770,7 +3770,7 @@ module Bdd_Impl10_And switch (let (_, a) = _25 in a) | Bdd_Node_Type.C_False -> goto BB12 | Bdd_Node_Type.C_If _ _ _ -> goto BB13 - | _ -> goto BB37 + | _ -> goto BB38 end } BB12 { @@ -3779,7 +3779,7 @@ module Bdd_Impl10_And BB13 { switch (let (a, _) = _25 in a) | Bdd_Node_Type.C_If _ _ _ -> goto BB14 - | _ -> goto BB38 + | _ -> goto BB39 end } BB14 { @@ -3789,22 +3789,22 @@ module Bdd_Impl10_And va <- Bdd_Node_Type.if_v (let (a, _) = _25 in a); childta <- Bdd_Node_Type.if_childt (let (a, _) = _25 in a); childfa <- Bdd_Node_Type.if_childf (let (a, _) = _25 in a); - assume { Resolve1.resolve _25 }; + assume { Resolve2.resolve _25 }; _47 <- vb; goto BB19 } BB15 { - assume { Resolve1.resolve _25 }; + assume { Resolve2.resolve _25 }; r1 <- b; goto BB33 } BB16 { - assume { Resolve1.resolve _25 }; + assume { Resolve2.resolve _25 }; r1 <- a; goto BB33 } BB17 { - assume { Resolve1.resolve _25 }; + assume { Resolve2.resolve _25 }; _33 <- borrow_mut ( * self); self <- { self with current = ( ^ _33) }; r1 <- ([#"../bdd.rs" 545 39 545 52] False0.false_ _33); @@ -3902,7 +3902,7 @@ module Bdd_Impl10_And goto BB34 } BB34 { - assume { Resolve2.resolve self }; + assume { Resolve1.resolve self }; _0 <- r1; goto BB35 } @@ -3910,21 +3910,21 @@ module Bdd_Impl10_And return _0 } BB37 { - assume { Resolve1.resolve _25 }; - assume { Resolve2.resolve self }; - goto BB4 + goto BB21 } BB38 { - assume { Resolve1.resolve _25 }; - assume { Resolve2.resolve self }; + assume { Resolve2.resolve _25 }; + assume { Resolve1.resolve self }; goto BB4 } BB39 { - assume { Resolve2.resolve self }; + assume { Resolve2.resolve _25 }; + assume { Resolve1.resolve self }; goto BB4 } BB40 { - goto BB21 + assume { Resolve1.resolve self }; + goto BB4 } end diff --git a/creusot/tests/should_succeed/bdd/why3session.xml b/creusot/tests/should_succeed/bdd/why3session.xml index 8bdb8d2a45..15912d7b35 100644 --- a/creusot/tests/should_succeed/bdd/why3session.xml +++ b/creusot/tests/should_succeed/bdd/why3session.xml @@ -3,7 +3,7 @@ "http://why3.lri.fr/why3session.dtd"> - + @@ -202,7 +202,7 @@ - + @@ -211,23 +211,23 @@ - + - + - + - + - + @@ -249,7 +249,7 @@ - + @@ -261,33 +261,33 @@ - + - + - + - + - + - + @@ -296,52 +296,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -352,52 +352,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -408,52 +408,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -464,16 +464,16 @@ - + - + - + - + @@ -482,52 +482,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -539,31 +539,31 @@ - + - + - + - + - + - + - + - + @@ -574,13 +574,13 @@ - + - + - + @@ -595,13 +595,13 @@ - + - + - + @@ -612,7 +612,7 @@ - + @@ -633,49 +633,49 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -684,7 +684,7 @@ - + @@ -703,56 +703,56 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -763,52 +763,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -819,52 +819,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -887,52 +887,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -947,52 +947,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1009,38 +1009,38 @@ - + - + - + - + - + - + - + diff --git a/creusot/tests/should_succeed/bdd/why3shapes.gz b/creusot/tests/should_succeed/bdd/why3shapes.gz index f903a8f66b..6a4e06af9d 100644 Binary files a/creusot/tests/should_succeed/bdd/why3shapes.gz and b/creusot/tests/should_succeed/bdd/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/binary_search.mlcfg b/creusot/tests/should_succeed/binary_search.mlcfg index 19c54e3cbe..650fabcf4d 100644 --- a/creusot/tests/should_succeed/binary_search.mlcfg +++ b/creusot/tests/should_succeed/binary_search.mlcfg @@ -142,11 +142,11 @@ module BinarySearch_Impl0_Index use prelude.Int use prelude.Borrow use Core_Option_Option_Type as Core_Option_Option_Type - use BinarySearch_List_Type as BinarySearch_List_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with - type self = BinarySearch_List_Type.t_list t - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = t + use BinarySearch_List_Type as BinarySearch_List_Type + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + type self = BinarySearch_List_Type.t_list t clone BinarySearch_Impl0_Get as Get0 with type t = t clone BinarySearch_Impl0_LenLogic as LenLogic0 with @@ -200,18 +200,18 @@ module BinarySearch_Impl0_Index end } BB5 { - assume { Resolve1.resolve t }; + assume { Resolve2.resolve t }; _17 <- ls; - assume { Resolve2.resolve ls }; - assume { Resolve2.resolve _17 }; + assume { Resolve1.resolve ls }; + assume { Resolve1.resolve _17 }; l <- _17; ix <- ([#"../binary_search.rs" 54 16 54 23] ix - ([#"../binary_search.rs" 54 22 54 23] (1 : usize))); goto BB1 } BB6 { - assume { Resolve2.resolve ls }; + assume { Resolve1.resolve ls }; _0 <- t; - assume { Resolve1.resolve t }; + assume { Resolve2.resolve t }; return _0 } BB7 { @@ -404,6 +404,7 @@ module BinarySearch_BinarySearch type t = uint32 clone BinarySearch_Impl1_IsSorted as IsSorted0 with function Get0.get = Get0.get + use Core_Result_Result_Type as Core_Result_Result_Type clone BinarySearch_Impl0_LenLogic as LenLogic0 with type t = uint32, axiom . @@ -414,7 +415,6 @@ module BinarySearch_BinarySearch clone BinarySearch_Impl0_GetDefault as GetDefault0 with type t = uint32, function Get0.get = Get0.get - use Core_Result_Result_Type as Core_Result_Result_Type clone BinarySearch_Impl0_Len_Interface as Len0 with type t = uint32, function LenLogic0.len_logic = LenLogic0.len_logic diff --git a/creusot/tests/should_succeed/binary_search/why3session.xml b/creusot/tests/should_succeed/binary_search/why3session.xml index 06717f3c48..275d6bd739 100644 --- a/creusot/tests/should_succeed/binary_search/why3session.xml +++ b/creusot/tests/should_succeed/binary_search/why3session.xml @@ -12,7 +12,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -45,10 +45,10 @@ - + - + @@ -60,25 +60,25 @@ - + - + - + - + - + - + - + diff --git a/creusot/tests/should_succeed/binary_search/why3shapes.gz b/creusot/tests/should_succeed/binary_search/why3shapes.gz index cd43cb006a..5aacfebf49 100644 Binary files a/creusot/tests/should_succeed/binary_search/why3shapes.gz and b/creusot/tests/should_succeed/binary_search/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/cell/02.mlcfg b/creusot/tests/should_succeed/cell/02.mlcfg index 13bd697846..07cb754e55 100644 --- a/creusot/tests/should_succeed/cell/02.mlcfg +++ b/creusot/tests/should_succeed/cell/02.mlcfg @@ -480,7 +480,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -689,7 +689,7 @@ module C02_FibMemo type t = Core_Option_Option_Type.t_option usize, type i = C02_Fib_Type.t_fib, predicate Inv0.inv = Inv0.inv - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = C02_Cell_Type.t_cell (Core_Option_Option_Type.t_option usize) (C02_Fib_Type.t_fib), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, diff --git a/creusot/tests/should_succeed/closures/05_map.mlcfg b/creusot/tests/should_succeed/closures/05_map.mlcfg index 566d7dd3e0..22f3f3a7e0 100644 --- a/creusot/tests/should_succeed/closures/05_map.mlcfg +++ b/creusot/tests/should_succeed/closures/05_map.mlcfg @@ -683,13 +683,13 @@ module C05Map_Impl0_Next clone CreusotContracts_Std1_Ops_Impl0_Precondition_Interface as Precondition0 with type args = a, type f = f - use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Ops_Function_Fn_Call_Interface as Call0 with type self = f, type args = a, predicate Precondition0.precondition = Precondition0.precondition, predicate Postcondition0.postcondition = Postcondition0.postcondition, type Output0.output = b + use Core_Option_Option_Type as Core_Option_Option_Type use C05Map_Map_Type as C05Map_Map_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = C05Map_Map_Type.t_map i f diff --git a/creusot/tests/should_succeed/constrained_types.mlcfg b/creusot/tests/should_succeed/constrained_types.mlcfg index 70b900f05c..7f6c871228 100644 --- a/creusot/tests/should_succeed/constrained_types.mlcfg +++ b/creusot/tests/should_succeed/constrained_types.mlcfg @@ -178,7 +178,7 @@ module CreusotContracts_Logic_Ord_Impl0_LtLog ensures { result = lt_log self o } end -module Core_Tuple_Impl11_Lt_Interface +module Core_Tuple_Impl17_Lt_Interface type u type t use prelude.Borrow @@ -332,7 +332,7 @@ module ConstrainedTypes_UsesConcreteInstance type t2 = uint32, predicate Resolve0.resolve = Resolve1.resolve, predicate Resolve1.resolve = Resolve1.resolve - clone Core_Tuple_Impl11_Lt_Interface as Lt0 with + clone Core_Tuple_Impl17_Lt_Interface as Lt0 with type u = uint32, type t = uint32, function DeepModel0.deep_model = DeepModel0.deep_model, diff --git a/creusot/tests/should_succeed/filter_positive.mlcfg b/creusot/tests/should_succeed/filter_positive.mlcfg index 75bd6bc68d..d3a172a19c 100644 --- a/creusot/tests/should_succeed/filter_positive.mlcfg +++ b/creusot/tests/should_succeed/filter_positive.mlcfg @@ -244,28 +244,6 @@ module CreusotContracts_Std1_Vec_Impl0_ShallowModel axiom shallow_model_spec : forall self : Alloc_Vec_Vec_Type.t_vec t a . [#"../../../../creusot-contracts/src/std/vec.rs" 18 14 18 41] Seq.length (shallow_model self) <= UIntSize.to_int Max0.mAX' end -module CreusotContracts_Resolve_Impl1_Resolve_Stub - type t - use prelude.Borrow - predicate resolve (self : borrowed t) -end -module CreusotContracts_Resolve_Impl1_Resolve_Interface - type t - use prelude.Borrow - predicate resolve (self : borrowed t) - val resolve (self : borrowed t) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Resolve_Impl1_Resolve - type t - use prelude.Borrow - predicate resolve (self : borrowed t) = - [#"../../../../creusot-contracts/src/resolve.rs" 25 20 25 34] ^ self = * self - val resolve (self : borrowed t) : bool - ensures { result = resolve self } - -end module CreusotContracts_Model_ShallowModel_ShallowModelTy_Type type self type shallowModelTy @@ -379,6 +357,28 @@ module CreusotContracts_Std1_Vec_Impl10_Resolve val resolve (self : Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)) : bool ensures { result = resolve self } +end +module CreusotContracts_Resolve_Impl1_Resolve_Stub + type t + use prelude.Borrow + predicate resolve (self : borrowed t) +end +module CreusotContracts_Resolve_Impl1_Resolve_Interface + type t + use prelude.Borrow + predicate resolve (self : borrowed t) + val resolve (self : borrowed t) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Resolve_Impl1_Resolve + type t + use prelude.Borrow + predicate resolve (self : borrowed t) = + [#"../../../../creusot-contracts/src/resolve.rs" 25 20 25 34] ^ self = * self + val resolve (self : borrowed t) : bool + ensures { result = resolve self } + end module CreusotContracts_Model_Impl5_ShallowModel_Stub type t @@ -426,6 +426,27 @@ module Alloc_Vec_Impl1_Len_Interface val len (self : Alloc_Vec_Vec_Type.t_vec t a) : usize ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 66 26 66 48] UIntSize.to_int result = Seq.length (ShallowModel0.shallow_model self) } +end +module Alloc_Vec_FromElem_Interface + type t + use seq.Seq + use prelude.UIntSize + use prelude.Int + clone Core_Num_Impl11_Max_Stub as Max0 + use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type + use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic_Stub as IndexLogic0 with + type t = t, + type s = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Stub as ShallowModel0 with + type t = t, + type a = Alloc_Alloc_Global_Type.t_global, + val Max0.mAX' = Max0.mAX', + axiom . + val from_elem (elem : t) (n : usize) : Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 147 22 147 41] Seq.length (ShallowModel0.shallow_model result) = UIntSize.to_int n } + ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 148 12 148 78] forall i : int . 0 <= i /\ i < UIntSize.to_int n -> IndexLogic0.index_logic result i = elem } + end module CreusotContracts_Std1_Slice_SliceIndex_InBounds_Stub type self @@ -495,7 +516,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -523,27 +544,6 @@ module Alloc_Vec_Impl13_Index_Interface requires {[#"../../../../creusot-contracts/src/std/vec.rs" 131 27 131 46] InBounds0.in_bounds index (ShallowModel0.shallow_model self)} ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 132 26 132 54] HasValue0.has_value index (ShallowModel0.shallow_model self) result } -end -module Alloc_Vec_FromElem_Interface - type t - use seq.Seq - use prelude.UIntSize - use prelude.Int - clone Core_Num_Impl11_Max_Stub as Max0 - use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type - use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic_Stub as IndexLogic0 with - type t = t, - type s = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Stub as ShallowModel0 with - type t = t, - type a = Alloc_Alloc_Global_Type.t_global, - val Max0.mAX' = Max0.mAX', - axiom . - val from_elem (elem : t) (n : usize) : Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 147 22 147 41] Seq.length (ShallowModel0.shallow_model result) = UIntSize.to_int n } - ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 148 12 148 78] forall i : int . 0 <= i /\ i < UIntSize.to_int n -> IndexLogic0.index_logic result i = elem } - end module CreusotContracts_Model_Impl7_ShallowModel_Stub type t @@ -606,7 +606,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -647,6 +647,25 @@ module Alloc_Vec_Impl14_IndexMut_Interface ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 125 26 125 62] ResolveElswhere0.resolve_elswhere index (ShallowModel0.shallow_model self) (ShallowModel1.shallow_model ( ^ self)) } ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 126 26 126 55] Seq.length (ShallowModel1.shallow_model ( ^ self)) = Seq.length (ShallowModel0.shallow_model self) } +end +module CreusotContracts_Resolve_Impl2_Resolve_Stub + type t + predicate resolve (self : t) +end +module CreusotContracts_Resolve_Impl2_Resolve_Interface + type t + predicate resolve (self : t) + val resolve (self : t) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Resolve_Impl2_Resolve + type t + predicate resolve (self : t) = + [#"../../../../creusot-contracts/src/resolve.rs" 36 8 36 12] true + val resolve (self : t) : bool + ensures { result = resolve self } + end module CreusotContracts_Std1_Slice_Impl5_InBounds_Stub type t @@ -731,25 +750,6 @@ module CreusotContracts_Std1_Slice_Impl5_ResolveElswhere val resolve_elswhere [@inline:trivial] (self : usize) (old' : Seq.seq t) (fin : Seq.seq t) : bool ensures { result = resolve_elswhere self old' fin } -end -module CreusotContracts_Resolve_Impl2_Resolve_Stub - type t - predicate resolve (self : t) -end -module CreusotContracts_Resolve_Impl2_Resolve_Interface - type t - predicate resolve (self : t) - val resolve (self : t) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Resolve_Impl2_Resolve - type t - predicate resolve (self : t) = - [#"../../../../creusot-contracts/src/resolve.rs" 36 8 36 12] true - val resolve (self : t) : bool - ensures { result = resolve self } - end module FilterPositive_M_Interface use prelude.Int @@ -765,8 +765,6 @@ module FilterPositive_M use seq.Seq use prelude.Int32 use prelude.Borrow - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with - type t = int32 clone CreusotContracts_Std1_Slice_Impl5_ResolveElswhere as ResolveElswhere0 with type t = int32 use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type @@ -782,27 +780,23 @@ module FilterPositive_M type t = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq int32, function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with - type t = int32, - type s = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue0 with type t = int32 clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds0 with type t = int32 + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with + type t = int32 + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with + type t = int32, + type s = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel1 with type t = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq int32, function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve1 with - type t = int32, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve2.resolve, - val Max0.mAX' = Max0.mAX' - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = int32 - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = int32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -821,12 +815,7 @@ module FilterPositive_M clone FilterPositive_LemmaNumOfPosStrictlyIncreasing as LemmaNumOfPosStrictlyIncreasing0 with function NumOfPos0.num_of_pos = NumOfPos0.num_of_pos, axiom . - clone Alloc_Vec_FromElem_Interface as FromElem0 with - type t = int32, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = int32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -834,6 +823,17 @@ module FilterPositive_M predicate InBounds0.in_bounds = InBounds0.in_bounds, predicate HasValue0.has_value = HasValue0.has_value, type Output0.output = int32 + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve0 with + type t = int32, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve2.resolve, + val Max0.mAX' = Max0.mAX' + clone Alloc_Vec_FromElem_Interface as FromElem0 with + type t = int32, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + val Max0.mAX' = Max0.mAX' clone Alloc_Vec_Impl1_Len_Interface as Len0 with type t = int32, type a = Alloc_Alloc_Global_Type.t_global, @@ -967,7 +967,7 @@ module FilterPositive_M } BB24 { _46 <- { _46 with current = _43 }; - assume { Resolve0.resolve _46 }; + assume { Resolve1.resolve _46 }; count <- ([#"../filter_positive.rs" 114 12 114 22] count + ([#"../filter_positive.rs" 114 21 114 22] (1 : usize))); _32 <- (); goto BB26 @@ -982,7 +982,7 @@ module FilterPositive_M goto BB15 } BB27 { - assume { Resolve1.resolve t }; + assume { Resolve0.resolve t }; _0 <- u; u <- any Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global); goto BB28 diff --git a/creusot/tests/should_succeed/filter_positive/why3session.xml b/creusot/tests/should_succeed/filter_positive/why3session.xml index 96a59c0645..64a1af4319 100644 --- a/creusot/tests/should_succeed/filter_positive/why3session.xml +++ b/creusot/tests/should_succeed/filter_positive/why3session.xml @@ -2,8 +2,8 @@ + - @@ -23,7 +23,7 @@ - + diff --git a/creusot/tests/should_succeed/filter_positive/why3shapes.gz b/creusot/tests/should_succeed/filter_positive/why3shapes.gz index 3dc6d60902..24c56df596 100644 Binary files a/creusot/tests/should_succeed/filter_positive/why3shapes.gz and b/creusot/tests/should_succeed/filter_positive/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/hashmap.mlcfg b/creusot/tests/should_succeed/hashmap.mlcfg index 0cf3fc6ebb..649931ce17 100644 --- a/creusot/tests/should_succeed/hashmap.mlcfg +++ b/creusot/tests/should_succeed/hashmap.mlcfg @@ -1074,7 +1074,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -1331,18 +1331,8 @@ module Hashmap_Impl5_Add type t = Hashmap_MyHashMap_Type.t_myhashmap k v, type ShallowModelTy0.shallowModelTy = Map.map DeepModelTy0.deepModelTy (Core_Option_Option_Type.t_option v), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve9 with - type t = v - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve8 with - type t = Hashmap_List_Type.t_list (k, v) - clone Core_Cmp_PartialEq_Eq_Interface as Eq0 with - type self = k, - type rhs = k, - function DeepModel0.deep_model = DeepModel1.deep_model, - function DeepModel1.deep_model = DeepModel1.deep_model, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve7 with - type t = k + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve9 with + type self = Hashmap_List_Type.t_list (k, v) clone Hashmap_Impl1_NoDoubleBinding as NoDoubleBinding0 with type k = k, type v = v, @@ -1363,19 +1353,29 @@ module Hashmap_Impl5_Add predicate GoodBucket0.good_bucket = GoodBucket0.good_bucket, predicate NoDoubleBinding0.no_double_binding = NoDoubleBinding0.no_double_binding, val Max0.mAX' = Max0.mAX' - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve6 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve8 with type t = Hashmap_MyHashMap_Type.t_myhashmap k v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with - type self = Hashmap_List_Type.t_list (k, v) - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve7 with type self = v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with type self = k + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve5 with + type t = Hashmap_List_Type.t_list (k, v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with + type t = v + clone Core_Cmp_PartialEq_Eq_Interface as Eq0 with + type self = k, + type rhs = k, + function DeepModel0.deep_model = DeepModel1.deep_model, + function DeepModel1.deep_model = DeepModel1.deep_model, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = k clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = Ghost.ghost_ty (borrowed (Hashmap_List_Type.t_list (k, v))) clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = Hashmap_List_Type.t_list (k, v) - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = Hashmap_List_Type.t_list (k, v), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1501,28 +1501,28 @@ module Hashmap_Impl5_Add goto BB11 } BB11 { - assume { Resolve7.resolve k }; + assume { Resolve3.resolve k }; switch ([#"../hashmap.rs" 124 15 124 24] Eq0.eq ( * k) key) | False -> goto BB13 | True -> goto BB12 end } BB12 { - assume { Resolve8.resolve tl1 }; - assume { Resolve3.resolve key }; - assume { Resolve4.resolve val' }; + assume { Resolve5.resolve tl1 }; + assume { Resolve6.resolve key }; + assume { Resolve7.resolve val' }; v <- { v with current = val' }; - assume { Resolve4.resolve ( * v) }; - assume { Resolve9.resolve v }; + assume { Resolve7.resolve ( * v) }; + assume { Resolve4.resolve v }; assume { Resolve1.resolve _19 }; assume { Resolve1.resolve l }; - assume { Resolve6.resolve self }; + assume { Resolve8.resolve self }; assert { [@expl:assertion] [#"../hashmap.rs" 126 32 126 52] HashmapInv0.hashmap_inv ( * self) }; _0 <- (); goto BB20 } BB13 { - assume { Resolve9.resolve v }; + assume { Resolve4.resolve v }; _47 <- borrow_mut ( * tl1); tl1 <- { tl1 with current = ( ^ _47) }; _46 <- borrow_mut ( * _47); @@ -1531,12 +1531,12 @@ module Hashmap_Impl5_Add l <- _46; _46 <- any borrowed (Hashmap_List_Type.t_list (k, v)); assume { Resolve1.resolve _47 }; - assume { Resolve8.resolve tl1 }; + assume { Resolve5.resolve tl1 }; goto BB7 } BB14 { - assume { Resolve3.resolve key }; - assume { Resolve4.resolve val' }; + assume { Resolve6.resolve key }; + assume { Resolve7.resolve val' }; goto BB15 } BB15 { @@ -1547,13 +1547,13 @@ module Hashmap_Impl5_Add } BB17 { l <- { l with current = Hashmap_List_Type.C_Cons (key, val') (Hashmap_List_Type.C_Nil) }; - assume { Resolve5.resolve ( * l) }; + assume { Resolve9.resolve ( * l) }; assume { Resolve1.resolve l }; goto BB19 } BB19 { assume { Resolve1.resolve _19 }; - assume { Resolve6.resolve self }; + assume { Resolve8.resolve self }; assert { [@expl:assertion] [#"../hashmap.rs" 134 24 134 44] HashmapInv0.hashmap_inv ( * self) }; _0 <- (); goto BB20 @@ -1563,7 +1563,7 @@ module Hashmap_Impl5_Add } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -1714,22 +1714,22 @@ module Hashmap_Impl5_Get predicate NoDoubleBinding0.no_double_binding = NoDoubleBinding0.no_double_binding, val Max0.mAX' = Max0.mAX' clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with - type self = v + type self = k clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with type self = Hashmap_List_Type.t_list (k, v) + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + type self = v clone Core_Cmp_PartialEq_Eq_Interface as Eq0 with type self = k, type rhs = k, function DeepModel0.deep_model = DeepModel1.deep_model, function DeepModel1.deep_model = DeepModel1.deep_model, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with - type self = k clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = k clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = Hashmap_List_Type.t_list (k, v) - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = Hashmap_List_Type.t_list (k, v), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1813,7 +1813,7 @@ module Hashmap_Impl5_Get v <- (let (_, a) = Hashmap_List_Type.cons_0 l in a); tl <- Hashmap_List_Type.cons_1 l; assume { Resolve1.resolve l }; - assume { Resolve3.resolve k }; + assume { Resolve2.resolve k }; goto BB9 } BB9 { @@ -1824,13 +1824,13 @@ module Hashmap_Impl5_Get } BB10 { assume { Resolve4.resolve tl }; - assume { Resolve2.resolve key }; - assume { Resolve5.resolve v }; + assume { Resolve5.resolve key }; + assume { Resolve3.resolve v }; _0 <- Core_Option_Option_Type.C_Some v; goto BB13 } BB11 { - assume { Resolve5.resolve v }; + assume { Resolve3.resolve v }; _31 <- tl; assume { Resolve4.resolve tl }; assume { Resolve1.resolve _31 }; @@ -1839,7 +1839,7 @@ module Hashmap_Impl5_Get } BB12 { assume { Resolve1.resolve l }; - assume { Resolve2.resolve key }; + assume { Resolve5.resolve key }; _0 <- Core_Option_Option_Type.C_None; goto BB13 } @@ -2006,11 +2006,7 @@ module Hashmap_Impl5_Resize type ShallowModelTy0.shallowModelTy = Seq.seq (Hashmap_List_Type.t_list (k, v)), function ShallowModel0.shallow_model = ShallowModel2.shallow_model use prelude.Ghost - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve7 with - type t = Hashmap_MyHashMap_Type.t_myhashmap k v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with - type self = Hashmap_MyHashMap_Type.t_myhashmap k v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve7 with type self = Hashmap_List_Type.t_list (k, v) clone Hashmap_Impl1_NoDoubleBinding as NoDoubleBinding0 with type k = k, @@ -2040,17 +2036,17 @@ module Hashmap_Impl5_Resize function ShallowModel0.shallow_model = ShallowModel1.shallow_model, function DeepModel0.deep_model = DeepModel0.deep_model, function ShallowModel1.shallow_model = ShallowModel3.shallow_model - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with type self = v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with type self = k - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with type self = Hashmap_List_Type.t_list (k, v) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = Hashmap_List_Type.t_list (k, v) clone Core_Mem_Replace_Interface as Replace0 with type t = Hashmap_List_Type.t_list (k, v) - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = Hashmap_List_Type.t_list (k, v), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2061,6 +2057,10 @@ module Hashmap_Impl5_Resize function ShallowModel1.shallow_model = ShallowModel2.shallow_model, predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere0.resolve_elswhere, val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Hashmap_MyHashMap_Type.t_myhashmap k v + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + type self = Hashmap_MyHashMap_Type.t_myhashmap k v clone CreusotContracts_Ghost_Impl1_ShallowModel as ShallowModel0 with type t = borrowed (Hashmap_MyHashMap_Type.t_myhashmap k v), type ShallowModelTy0.shallowModelTy = Map.map DeepModelTy0.deepModelTy (Core_Option_Option_Type.t_option v), @@ -2161,8 +2161,8 @@ module Hashmap_Impl5_Resize goto BB11 } BB11 { - assume { Resolve1.resolve _29 }; - assume { Resolve1.resolve _28 }; + assume { Resolve3.resolve _29 }; + assume { Resolve3.resolve _28 }; goto BB12 } BB12 { @@ -2206,17 +2206,17 @@ module Hashmap_Impl5_Resize v <- (let (_, a) = Hashmap_List_Type.cons_0 l in a); tl <- Hashmap_List_Type.cons_1 l; l <- (let Hashmap_List_Type.C_Cons a b = l in Hashmap_List_Type.C_Cons a (any Hashmap_List_Type.t_list (k, v))); - assume { Resolve2.resolve l }; + assume { Resolve4.resolve l }; _45 <- borrow_mut new; new <- ^ _45; - assume { Resolve3.resolve k }; - assume { Resolve4.resolve v }; + assume { Resolve5.resolve k }; + assume { Resolve6.resolve v }; _44 <- ([#"../hashmap.rs" 190 16 190 29] Add0.add _45 k v); _45 <- any borrowed (Hashmap_MyHashMap_Type.t_myhashmap k v); goto BB21 } BB21 { - assume { Resolve5.resolve tl }; + assume { Resolve7.resolve tl }; goto BB22 } BB22 { @@ -2229,7 +2229,7 @@ module Hashmap_Impl5_Resize goto BB26 } BB25 { - assume { Resolve2.resolve l }; + assume { Resolve4.resolve l }; assert { [@expl:assertion] [#"../hashmap.rs" 193 12 193 121] forall k : DeepModelTy0.deepModelTy . BucketIx0.bucket_ix ( * Ghost.inner old_self) k = UIntSize.to_int i -> Map.get (ShallowModel0.shallow_model old_self) k = Map.get (ShallowModel1.shallow_model new) k }; goto BB27 } @@ -2250,8 +2250,8 @@ module Hashmap_Impl5_Resize BB30 { self <- { self with current = new }; new <- any Hashmap_MyHashMap_Type.t_myhashmap k v; - assume { Resolve6.resolve ( * self) }; - assume { Resolve7.resolve self }; + assume { Resolve1.resolve ( * self) }; + assume { Resolve2.resolve self }; goto BB32 } BB32 { diff --git a/creusot/tests/should_succeed/hashmap/why3session.xml b/creusot/tests/should_succeed/hashmap/why3session.xml index a7709cbb5f..2e2b6fd7b3 100644 --- a/creusot/tests/should_succeed/hashmap/why3session.xml +++ b/creusot/tests/should_succeed/hashmap/why3session.xml @@ -2,8 +2,8 @@ - + @@ -30,16 +30,16 @@ - + - + - + - + @@ -51,7 +51,7 @@ - + @@ -61,17 +61,17 @@ - + - + - + @@ -81,16 +81,16 @@ - + - + - + - + @@ -112,28 +112,28 @@ - + - + - + - + - + - + @@ -142,7 +142,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -188,43 +188,43 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -233,13 +233,13 @@ - + - + @@ -251,7 +251,7 @@ - + diff --git a/creusot/tests/should_succeed/hashmap/why3shapes.gz b/creusot/tests/should_succeed/hashmap/why3shapes.gz index 5976497c6d..eb652e91f4 100644 Binary files a/creusot/tests/should_succeed/hashmap/why3shapes.gz and b/creusot/tests/should_succeed/hashmap/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/heapsort_generic.mlcfg b/creusot/tests/should_succeed/heapsort_generic.mlcfg index 7e82229797..0fbc579753 100644 --- a/creusot/tests/should_succeed/heapsort_generic.mlcfg +++ b/creusot/tests/should_succeed/heapsort_generic.mlcfg @@ -1105,7 +1105,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -1240,7 +1240,7 @@ module CreusotContracts_Std1_Slice_Impl0_ShallowModel axiom shallow_model_spec : forall self : slice t . ([#"../../../../creusot-contracts/src/std/slice.rs" 19 14 19 41] shallow_model self = Slice.id self) && ([#"../../../../creusot-contracts/src/std/slice.rs" 18 14 18 41] Seq.length (shallow_model self) <= UIntSize.to_int Max0.mAX') end -module Alloc_Vec_Impl10_DerefMut_Interface +module Alloc_Vec_Impl9_DerefMut_Interface type t type a use prelude.Borrow @@ -1526,13 +1526,15 @@ module HeapsortGeneric_SiftDown function Parent0.parent = Parent0.parent, function LeLog0.le_log = LeLog0.le_log clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = slice t clone Core_Slice_Impl0_Swap_Interface as Swap0 with type t = t, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, function ShallowModel1.shallow_model = ShallowModel6.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl10_DerefMut_Interface as DerefMut0 with + clone Alloc_Vec_Impl9_DerefMut_Interface as DerefMut0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, @@ -1554,9 +1556,9 @@ module HeapsortGeneric_SiftDown function DeepModel1.deep_model = DeepModel2.deep_model, function LtLog0.lt_log = LtLog0.lt_log, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = t - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1564,8 +1566,6 @@ module HeapsortGeneric_SiftDown predicate InBounds0.in_bounds = InBounds0.in_bounds, predicate HasValue0.has_value = HasValue0.has_value, type Output0.output = t - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) clone CreusotContracts_Model_Impl6_DeepModel as DeepModel0 with type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), type DeepModelTy0.deepModelTy = Seq.seq DeepModelTy0.deepModelTy, @@ -1648,7 +1648,7 @@ module HeapsortGeneric_SiftDown end } BB5 { - assume { Resolve1.resolve v }; + assume { Resolve3.resolve v }; _0 <- (); goto BB23 } @@ -1674,12 +1674,12 @@ module HeapsortGeneric_SiftDown end } BB10 { - assume { Resolve2.resolve _41 }; + assume { Resolve1.resolve _41 }; _45 <- ([#"../heapsort_generic.rs" 65 41 65 53] Index0.index ( * v) ([#"../heapsort_generic.rs" 65 43 65 52] child + ([#"../heapsort_generic.rs" 65 51 65 52] (1 : usize)))); goto BB11 } BB11 { - assume { Resolve2.resolve _45 }; + assume { Resolve1.resolve _45 }; goto BB12 } BB12 { @@ -1700,12 +1700,12 @@ module HeapsortGeneric_SiftDown goto BB16 } BB16 { - assume { Resolve2.resolve _52 }; + assume { Resolve1.resolve _52 }; _56 <- ([#"../heapsort_generic.rs" 68 23 68 27] Index0.index ( * v) i); goto BB17 } BB17 { - assume { Resolve2.resolve _56 }; + assume { Resolve1.resolve _56 }; goto BB18 } BB18 { @@ -1715,7 +1715,7 @@ module HeapsortGeneric_SiftDown end } BB19 { - assume { Resolve1.resolve v }; + assume { Resolve3.resolve v }; _0 <- (); goto BB23 } @@ -1734,7 +1734,7 @@ module HeapsortGeneric_SiftDown goto BB22 } BB22 { - assume { Resolve3.resolve _62 }; + assume { Resolve2.resolve _62 }; i <- child; goto BB2 } @@ -1886,12 +1886,34 @@ module HeapsortGeneric_HeapSort use Core_Cmp_Ordering_Type as Core_Cmp_Ordering_Type clone CreusotContracts_Logic_Ord_OrdLogic_CmpLog_Interface as CmpLog0 with type self = DeepModelTy0.deepModelTy + clone CreusotContracts_Model_DeepModel_DeepModel_Interface as DeepModel2 with + type self = t, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy + use seq.Seq + use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type + use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type clone Core_Num_Impl11_Max as Max1 + clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel2 with + type t = t, + type a = Alloc_Alloc_Global_Type.t_global, + val Max0.mAX' = Max1.mAX', + axiom . + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic1 with + type t = t, + type s = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel2.shallow_model + clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel0 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), + type ShallowModelTy0.shallowModelTy = Seq.seq t, + function ShallowModel0.shallow_model = ShallowModel2.shallow_model + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with + type t = t, + type s = borrowed (Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)), + function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone CreusotContracts_Std1_Slice_Impl0_ShallowModel_Interface as ShallowModel6 with type t = t, val Max0.mAX' = Max1.mAX', axiom . - use seq.Seq clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel5 with type t = slice t, type ShallowModelTy0.shallowModelTy = Seq.seq t, @@ -1938,28 +1960,6 @@ module HeapsortGeneric_HeapSort function LeLog0.le_log = LeLog0.le_log, function CmpLog0.cmp_log = CmpLog0.cmp_log, axiom . - clone CreusotContracts_Model_DeepModel_DeepModel_Interface as DeepModel2 with - type self = t, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type - use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type - clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel2 with - type t = t, - type a = Alloc_Alloc_Global_Type.t_global, - val Max0.mAX' = Max1.mAX', - axiom . - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic1 with - type t = t, - type s = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel0 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), - type ShallowModelTy0.shallowModelTy = Seq.seq t, - function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with - type t = t, - type s = borrowed (Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)), - function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone HeapsortGeneric_Parent as Parent0 clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel4 with type t = borrowed (Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)), @@ -1986,26 +1986,44 @@ module HeapsortGeneric_HeapSort val Max0.mAX' = Max1.mAX', axiom . clone Core_Usize_Max as Max0 - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Logic_Seq_Impl0_PermutationOf as PermutationOf0 with + type t = t clone HeapsortGeneric_HeapFrag as HeapFrag0 with type t = DeepModelTy0.deepModelTy, function Parent0.parent = Parent0.parent, function LeLog0.le_log = LeLog0.le_log + clone CreusotContracts_Model_Impl6_DeepModel as DeepModel0 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), + type DeepModelTy0.deepModelTy = Seq.seq DeepModelTy0.deepModelTy, + function DeepModel0.deep_model = DeepModel1.deep_model + clone HeapsortGeneric_SiftDown_Interface as SiftDown0 with + type t = t, + function DeepModel0.deep_model = DeepModel0.deep_model, + predicate HeapFrag0.heap_frag = HeapFrag0.heap_frag, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function DeepModel1.deep_model = DeepModel1.deep_model, + function ShallowModel1.shallow_model = ShallowModel2.shallow_model, + predicate PermutationOf0.permutation_of = PermutationOf0.permutation_of, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + function IndexLogic1.index_logic = IndexLogic1.index_logic, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, + function LeLog0.le_log = LeLog0.le_log, + function DeepModel2.deep_model = DeepModel2.deep_model, + val Max0.mAX' = Max1.mAX' clone HeapsortGeneric_HeapFragMax as HeapFragMax0 with type t = DeepModelTy0.deepModelTy, predicate HeapFrag0.heap_frag = HeapFrag0.heap_frag, function LeLog0.le_log = LeLog0.le_log, function Parent0.parent = Parent0.parent, axiom . - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = slice t clone Core_Slice_Impl0_Swap_Interface as Swap0 with type t = t, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, function ShallowModel1.shallow_model = ShallowModel6.shallow_model, val Max0.mAX' = Max1.mAX' - clone Alloc_Vec_Impl10_DerefMut_Interface as DerefMut0 with + clone Alloc_Vec_Impl9_DerefMut_Interface as DerefMut0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, @@ -2013,26 +2031,8 @@ module HeapsortGeneric_HeapSort function ShallowModel2.shallow_model = ShallowModel6.shallow_model, function ShallowModel3.shallow_model = ShallowModel2.shallow_model, val Max0.mAX' = Max1.mAX' - clone CreusotContracts_Logic_Seq_Impl0_PermutationOf as PermutationOf0 with - type t = t - clone CreusotContracts_Model_Impl6_DeepModel as DeepModel0 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), - type DeepModelTy0.deepModelTy = Seq.seq DeepModelTy0.deepModelTy, - function DeepModel0.deep_model = DeepModel1.deep_model - clone HeapsortGeneric_SiftDown_Interface as SiftDown0 with - type t = t, - function DeepModel0.deep_model = DeepModel0.deep_model, - predicate HeapFrag0.heap_frag = HeapFrag0.heap_frag, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function DeepModel1.deep_model = DeepModel1.deep_model, - function ShallowModel1.shallow_model = ShallowModel2.shallow_model, - predicate PermutationOf0.permutation_of = PermutationOf0.permutation_of, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - function IndexLogic1.index_logic = IndexLogic1.index_logic, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, - function LeLog0.le_log = LeLog0.le_log, - function DeepModel2.deep_model = DeepModel2.deep_model, - val Max0.mAX' = Max1.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) clone CreusotContracts_Ghost_Impl1_ShallowModel as ShallowModel1 with type t = borrowed (Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)), type ShallowModelTy0.shallowModelTy = Seq.seq t, @@ -2148,7 +2148,7 @@ module HeapsortGeneric_HeapSort goto BB15 } BB15 { - assume { Resolve1.resolve _37 }; + assume { Resolve2.resolve _37 }; assert { [@expl:assertion] [#"../heapsort_generic.rs" 119 12 119 59] let _ = HeapFragMax0.heap_frag_max (DeepModel0.deep_model v) 0 (UIntSize.to_int end') in forall j : int . forall i : int . 0 <= i /\ i < UIntSize.to_int end' /\ UIntSize.to_int end' <= j /\ j < Seq.length (ShallowModel0.shallow_model v) -> LeLog0.le_log (Seq.get (DeepModel0.deep_model v) i) (Seq.get (DeepModel0.deep_model v) j) }; _43 <- borrow_mut ( * v); v <- { v with current = ( ^ _43) }; @@ -2161,7 +2161,7 @@ module HeapsortGeneric_HeapSort goto BB11 } BB17 { - assume { Resolve2.resolve v }; + assume { Resolve1.resolve v }; _0 <- (); return _0 } diff --git a/creusot/tests/should_succeed/heapsort_generic/why3session.xml b/creusot/tests/should_succeed/heapsort_generic/why3session.xml index 9f4403ed0f..564d848754 100644 --- a/creusot/tests/should_succeed/heapsort_generic/why3session.xml +++ b/creusot/tests/should_succeed/heapsort_generic/why3session.xml @@ -4,8 +4,8 @@ + - @@ -23,19 +23,19 @@ - + - + - + @@ -44,46 +44,46 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -93,17 +93,17 @@ - + - + - + @@ -113,10 +113,10 @@ - + - + @@ -131,7 +131,7 @@ - + @@ -142,7 +142,7 @@ - + @@ -153,17 +153,17 @@ - + - + - + @@ -178,10 +178,10 @@ - + - + @@ -196,19 +196,19 @@ - + - + - + @@ -217,10 +217,10 @@ - + - + @@ -241,10 +241,10 @@ - + - + @@ -253,10 +253,10 @@ - + - + @@ -265,10 +265,10 @@ - + - + @@ -276,19 +276,20 @@ - + - + - + - + diff --git a/creusot/tests/should_succeed/heapsort_generic/why3shapes.gz b/creusot/tests/should_succeed/heapsort_generic/why3shapes.gz index 6ef49aa94e..916afd3561 100644 Binary files a/creusot/tests/should_succeed/heapsort_generic/why3shapes.gz and b/creusot/tests/should_succeed/heapsort_generic/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/hillel.mlcfg b/creusot/tests/should_succeed/hillel.mlcfg index f34d7f12fb..779c83e865 100644 --- a/creusot/tests/should_succeed/hillel.mlcfg +++ b/creusot/tests/should_succeed/hillel.mlcfg @@ -382,16 +382,16 @@ module Hillel_RightPad type t = t, type s = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with - type self = t clone Alloc_Vec_Impl1_Push_Interface as Push0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, function ShallowModel1.shallow_model = ShallowModel1.shallow_model, val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + type self = t clone Alloc_Vec_Impl1_Len_Interface as Len0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, @@ -595,10 +595,6 @@ module Hillel_LeftPad type t = t, type s = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel3.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with - type self = t clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with type t = t, type s = borrowed (Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)), @@ -611,6 +607,10 @@ module Hillel_LeftPad function IndexLogic0.index_logic = IndexLogic2.index_logic, function IndexLogic1.index_logic = IndexLogic0.index_logic, val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + type self = t clone Alloc_Vec_Impl1_Len_Interface as Len0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, @@ -1185,7 +1185,7 @@ module Core_Option_Option_Type | C_Some a -> a end end -module Alloc_Vec_Impl9_Deref_Interface +module Alloc_Vec_Impl8_Deref_Interface type t type a use prelude.Borrow @@ -1682,20 +1682,20 @@ module Hillel_InsertUnique type t = DeepModelTy0.deepModelTy clone Hillel_Contains as Contains0 with type t = DeepModelTy0.deepModelTy + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve9 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve8 with + type self = t + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve7 with + type self = Core_Slice_Iter_Iter_Type.t_iter t clone Core_Cmp_Impls_Impl9_Eq_Interface as Eq0 with type a = t, type b = t, function DeepModel0.deep_model = DeepModel4.deep_model, function DeepModel1.deep_model = DeepModel4.deep_model, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve9 with - type self = t - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve8 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve7 with - type self = t clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with - type self = Core_Slice_Iter_Iter_Type.t_iter t + type self = t use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with type self = Core_Option_Option_Type.t_option t @@ -1720,7 +1720,7 @@ module Hillel_InsertUnique function ShallowModel0.shallow_model = ShallowModel2.shallow_model clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = slice t - clone Alloc_Vec_Impl9_Deref_Interface as Deref0 with + clone Alloc_Vec_Impl8_Deref_Interface as Deref0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel0.shallow_model, @@ -1833,7 +1833,7 @@ module Hillel_InsertUnique } BB14 { assume { Resolve5.resolve _26 }; - assume { Resolve6.resolve iter }; + assume { Resolve7.resolve iter }; assert { [@expl:assertion] [#"../hillel.rs" 92 20 92 71] IsUnique0.is_unique (Seq.snoc (DeepModel0.deep_model vec) (DeepModel1.deep_model elem)) }; goto BB23 } @@ -1842,9 +1842,9 @@ module Hillel_InsertUnique } BB16 { assume { Resolve5.resolve _26 }; - assume { Resolve6.resolve iter }; - assume { Resolve7.resolve elem }; - assume { Resolve8.resolve vec }; + assume { Resolve7.resolve iter }; + assume { Resolve8.resolve elem }; + assume { Resolve9.resolve vec }; absurd } BB17 { @@ -1858,23 +1858,23 @@ module Hillel_InsertUnique _31 <- any Ghost.ghost_ty (Seq.seq t); assume { Resolve3.resolve produced }; e <- __creusot_proc_iter_elem; - assume { Resolve9.resolve __creusot_proc_iter_elem }; + assume { Resolve6.resolve __creusot_proc_iter_elem }; assert { [@expl:assertion] [#"../hillel.rs" 85 24 85 54] e = IndexLogic1.index_logic ( * vec) (Seq.length (Ghost.inner produced) - 1) }; _39 <- elem; goto BB19 } BB19 { - assume { Resolve9.resolve _39 }; - assume { Resolve9.resolve e }; + assume { Resolve6.resolve _39 }; + assume { Resolve6.resolve e }; switch ([#"../hillel.rs" 86 11 86 21] Eq0.eq e _39) | False -> goto BB22 | True -> goto BB20 end } BB20 { - assume { Resolve6.resolve iter }; - assume { Resolve7.resolve elem }; - assume { Resolve8.resolve vec }; + assume { Resolve7.resolve iter }; + assume { Resolve8.resolve elem }; + assume { Resolve9.resolve vec }; assert { [@expl:assertion] [#"../hillel.rs" 87 28 87 73] Contains0.contains (DeepModel0.deep_model vec) (DeepModel1.deep_model elem) }; goto BB21 } @@ -1894,7 +1894,7 @@ module Hillel_InsertUnique goto BB24 } BB24 { - assume { Resolve8.resolve vec }; + assume { Resolve9.resolve vec }; _0 <- (); goto BB25 } @@ -2467,11 +2467,21 @@ module Hillel_Unique clone CreusotContracts_Std1_Iter_Impl0_IntoIterPre as IntoIterPre0 with type i = Core_Ops_Range_Range_Type.t_range usize use prelude.Ghost + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + type self = t + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve5 with + type t = t, + function ShallowModel0.shallow_model = ShallowModel1.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve2.resolve, + val Max0.mAX' = Max0.mAX' clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel0 with type t = slice t, type ShallowModelTy0.shallowModelTy = Seq.seq t, function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve5 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with + type self = slice t + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) clone Hillel_IsSubset as IsSubset0 with type t = DeepModelTy0.deepModelTy, @@ -2490,16 +2500,6 @@ module Hillel_Unique function ShallowModel0.shallow_model = ShallowModel1.shallow_model, function IndexLogic0.index_logic = IndexLogic0.index_logic, val Max0.mAX' = Max0.mAX' - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with - type self = t - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with - type self = slice t - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve2 with - type t = t, - function ShallowModel0.shallow_model = ShallowModel1.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve4.resolve, - val Max0.mAX' = Max0.mAX' use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Iter_Range_Impl3_Next_Interface as Next0 with type a = usize, @@ -2616,7 +2616,7 @@ module Hillel_Unique end } BB13 { - assume { Resolve3.resolve str }; + assume { Resolve4.resolve str }; assert { [@expl:assertion] [#"../hillel.rs" 112 20 112 95] IsSubset0.is_subset (SeqExt.subsequence (DeepModel1.deep_model str) 0 (Seq.length (ShallowModel0.shallow_model str))) (DeepModel0.deep_model unique) }; goto BB21 } @@ -2624,8 +2624,8 @@ module Hillel_Unique goto BB16 } BB15 { - assume { Resolve2.resolve unique }; - assume { Resolve3.resolve str }; + assume { Resolve5.resolve unique }; + assume { Resolve4.resolve str }; absurd } BB16 { @@ -2648,13 +2648,13 @@ module Hillel_Unique unique <- ^ _37; _36 <- borrow_mut ( * _37); _37 <- { _37 with current = ( ^ _36) }; - assume { Resolve4.resolve elem }; + assume { Resolve2.resolve elem }; _35 <- ([#"../hillel.rs" 108 8 108 40] InsertUnique0.insert_unique _36 elem); _36 <- any borrowed (Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)); goto BB19 } BB19 { - assume { Resolve5.resolve _37 }; + assume { Resolve3.resolve _37 }; _39 <- ([#"../hillel.rs" 109 18 109 47] Ghost.new (Seq.snoc (Ghost.inner sub_str) elem)); goto BB20 } diff --git a/creusot/tests/should_succeed/hillel/why3session.xml b/creusot/tests/should_succeed/hillel/why3session.xml index 7fcd527ee0..897ffc255c 100644 --- a/creusot/tests/should_succeed/hillel/why3session.xml +++ b/creusot/tests/should_succeed/hillel/why3session.xml @@ -4,18 +4,19 @@ + - + - + @@ -45,13 +46,13 @@ - + - + @@ -60,16 +61,16 @@ - + - + - + - + @@ -81,7 +82,7 @@ - + diff --git a/creusot/tests/should_succeed/hillel/why3shapes.gz b/creusot/tests/should_succeed/hillel/why3shapes.gz index f896931be6..36068e1a97 100644 Binary files a/creusot/tests/should_succeed/hillel/why3shapes.gz and b/creusot/tests/should_succeed/hillel/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/index_range.mlcfg b/creusot/tests/should_succeed/index_range.mlcfg index 42f517f925..eda01996c8 100644 --- a/creusot/tests/should_succeed/index_range.mlcfg +++ b/creusot/tests/should_succeed/index_range.mlcfg @@ -331,6 +331,28 @@ module IndexRange_CreateArr return _0 } +end +module CreusotContracts_Resolve_Impl1_Resolve_Stub + type t + use prelude.Borrow + predicate resolve (self : borrowed t) +end +module CreusotContracts_Resolve_Impl1_Resolve_Interface + type t + use prelude.Borrow + predicate resolve (self : borrowed t) + val resolve (self : borrowed t) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Resolve_Impl1_Resolve + type t + use prelude.Borrow + predicate resolve (self : borrowed t) = + [#"../../../../creusot-contracts/src/resolve.rs" 25 20 25 34] ^ self = * self + val resolve (self : borrowed t) : bool + ensures { result = resolve self } + end module CreusotContracts_Resolve_Resolve_Resolve_Stub type self @@ -387,28 +409,6 @@ module CreusotContracts_Std1_Vec_Impl10_Resolve val resolve (self : Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)) : bool ensures { result = resolve self } -end -module CreusotContracts_Resolve_Impl1_Resolve_Stub - type t - use prelude.Borrow - predicate resolve (self : borrowed t) -end -module CreusotContracts_Resolve_Impl1_Resolve_Interface - type t - use prelude.Borrow - predicate resolve (self : borrowed t) - val resolve (self : borrowed t) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Resolve_Impl1_Resolve - type t - use prelude.Borrow - predicate resolve (self : borrowed t) = - [#"../../../../creusot-contracts/src/resolve.rs" 25 20 25 34] ^ self = * self - val resolve (self : borrowed t) : bool - ensures { result = resolve self } - end module Core_Ops_Range_Range_Type type t_range 'idx = @@ -522,7 +522,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -566,7 +566,7 @@ module Core_Slice_Impl0_Len_Interface ensures { [#"../../../../creusot-contracts/src/std/slice.rs" 232 0 324 1] Seq.length (ShallowModel0.shallow_model self) = UIntSize.to_int result } end -module Alloc_Vec_Impl9_Deref_Interface +module Alloc_Vec_Impl8_Deref_Interface type t type a use prelude.Borrow @@ -656,7 +656,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -823,25 +823,6 @@ module CreusotContracts_Std1_Slice_Impl6_HasValue val has_value (self : Core_Ops_Range_Range_Type.t_range usize) (seq : Seq.seq t) (out : slice t) : bool ensures { result = has_value self seq out } -end -module CreusotContracts_Resolve_Impl2_Resolve_Stub - type t - predicate resolve (self : t) -end -module CreusotContracts_Resolve_Impl2_Resolve_Interface - type t - predicate resolve (self : t) - val resolve (self : t) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Resolve_Impl2_Resolve - type t - predicate resolve (self : t) = - [#"../../../../creusot-contracts/src/resolve.rs" 36 8 36 12] true - val resolve (self : t) : bool - ensures { result = resolve self } - end module CreusotContracts_Std1_Slice_Impl6_ResolveElswhere_Stub type t @@ -929,6 +910,25 @@ module CreusotContracts_Std1_Slice_Impl5_HasValue val has_value [@inline:trivial] (self : usize) (seq : Seq.seq t) (out : t) : bool ensures { result = has_value self seq out } +end +module CreusotContracts_Resolve_Impl2_Resolve_Stub + type t + predicate resolve (self : t) +end +module CreusotContracts_Resolve_Impl2_Resolve_Interface + type t + predicate resolve (self : t) + val resolve (self : t) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Resolve_Impl2_Resolve + type t + predicate resolve (self : t) = + [#"../../../../creusot-contracts/src/resolve.rs" 36 8 36 12] true + val resolve (self : t) : bool + ensures { result = resolve self } + end module IndexRange_TestRange_Interface val test_range [#"../index_range.rs" 27 0 27 19] (_1 : ()) : () @@ -945,6 +945,8 @@ module IndexRange_TestRange type t = int32, val Max0.mAX' = Max0.mAX', axiom . + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with + type t = int32 clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue1 with type t = int32 clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds1 with @@ -965,8 +967,6 @@ module IndexRange_TestRange type ShallowModelTy0.shallowModelTy = Seq.seq int32, function ShallowModel0.shallow_model = ShallowModel0.shallow_model use Core_Option_Option_Type as Core_Option_Option_Type - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with - type t = int32 clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel2 with type t = slice int32, type ShallowModelTy0.shallowModelTy = Seq.seq int32, @@ -985,7 +985,13 @@ module IndexRange_TestRange type t = int32, type s = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve1 with + type t = int32, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve2.resolve, + val Max0.mAX' = Max0.mAX' + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = int32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -997,9 +1003,9 @@ module IndexRange_TestRange type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = slice int32 - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = int32, type i = Core_Ops_Range_Range_Type.t_range usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1019,21 +1025,15 @@ module IndexRange_TestRange predicate InBounds0.in_bounds = InBounds0.in_bounds, type Output0.output = slice int32, predicate HasValue0.has_value = HasValue0.has_value - clone Alloc_Vec_Impl9_Deref_Interface as Deref0 with + clone Alloc_Vec_Impl8_Deref_Interface as Deref0 with type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, function ShallowModel1.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve0 with - type t = int32, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve2.resolve, - val Max0.mAX' = Max0.mAX' clone Core_Slice_Impl0_Len_Interface as Len0 with type t = int32, function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = int32, type i = Core_Ops_Range_Range_Type.t_range usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1147,7 +1147,7 @@ module IndexRange_TestRange goto BB5 } BB12 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB13 { @@ -1205,7 +1205,7 @@ module IndexRange_TestRange goto BB17 } BB24 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB25 { @@ -1222,7 +1222,7 @@ module IndexRange_TestRange end } BB28 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB29 { @@ -1239,7 +1239,7 @@ module IndexRange_TestRange end } BB32 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB33 { @@ -1259,7 +1259,7 @@ module IndexRange_TestRange end } BB37 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB38 { @@ -1279,7 +1279,7 @@ module IndexRange_TestRange end } BB42 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB43 { @@ -1299,7 +1299,7 @@ module IndexRange_TestRange end } BB47 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB48 { @@ -1319,7 +1319,7 @@ module IndexRange_TestRange end } BB52 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB53 { @@ -1341,9 +1341,9 @@ module IndexRange_TestRange end } BB56 { - assume { Resolve1.resolve s2 }; - assume { Resolve1.resolve _105 }; - assume { Resolve0.resolve arr }; + assume { Resolve0.resolve s2 }; + assume { Resolve0.resolve _105 }; + assume { Resolve1.resolve arr }; absurd } BB57 { @@ -1367,15 +1367,15 @@ module IndexRange_TestRange goto BB60 } BB60 { - assume { Resolve1.resolve s2 }; - assume { Resolve1.resolve _105 }; + assume { Resolve0.resolve s2 }; + assume { Resolve0.resolve _105 }; switch (not ([#"../index_range.rs" 67 12 67 21] Slice.get ( * s2) _124 = ([#"../index_range.rs" 67 20 67 21] (3 : int32)))) | False -> goto BB62 | True -> goto BB61 end } BB61 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB62 { @@ -1388,7 +1388,7 @@ module IndexRange_TestRange end } BB64 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB65 { @@ -1402,7 +1402,7 @@ module IndexRange_TestRange end } BB67 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB68 { @@ -1416,7 +1416,7 @@ module IndexRange_TestRange end } BB70 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB71 { @@ -1430,7 +1430,7 @@ module IndexRange_TestRange end } BB73 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB74 { @@ -1444,7 +1444,7 @@ module IndexRange_TestRange end } BB76 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB77 { @@ -1452,7 +1452,7 @@ module IndexRange_TestRange goto BB78 } BB78 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; switch (not ([#"../index_range.rs" 74 12 74 23] _166 = ([#"../index_range.rs" 74 22 74 23] (4 : int32)))) | False -> goto BB80 | True -> goto BB79 @@ -1596,6 +1596,8 @@ module IndexRange_TestRangeTo type t = int32, val Max0.mAX' = Max0.mAX', axiom . + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with + type t = int32 clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue1 with type t = int32 clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds1 with @@ -1616,8 +1618,6 @@ module IndexRange_TestRangeTo type ShallowModelTy0.shallowModelTy = Seq.seq int32, function ShallowModel0.shallow_model = ShallowModel0.shallow_model use Core_Option_Option_Type as Core_Option_Option_Type - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with - type t = int32 clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel2 with type t = slice int32, type ShallowModelTy0.shallowModelTy = Seq.seq int32, @@ -1636,7 +1636,13 @@ module IndexRange_TestRangeTo type t = int32, type s = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve1 with + type t = int32, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve2.resolve, + val Max0.mAX' = Max0.mAX' + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = int32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1648,9 +1654,9 @@ module IndexRange_TestRangeTo type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = slice int32 - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = int32, type i = Core_Ops_Range_RangeTo_Type.t_rangeto usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1670,21 +1676,15 @@ module IndexRange_TestRangeTo predicate InBounds0.in_bounds = InBounds0.in_bounds, type Output0.output = slice int32, predicate HasValue0.has_value = HasValue0.has_value - clone Alloc_Vec_Impl9_Deref_Interface as Deref0 with + clone Alloc_Vec_Impl8_Deref_Interface as Deref0 with type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, function ShallowModel1.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve0 with - type t = int32, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve2.resolve, - val Max0.mAX' = Max0.mAX' clone Core_Slice_Impl0_Len_Interface as Len0 with type t = int32, function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = int32, type i = Core_Ops_Range_RangeTo_Type.t_rangeto usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1786,7 +1786,7 @@ module IndexRange_TestRangeTo goto BB5 } BB12 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB13 { @@ -1803,7 +1803,7 @@ module IndexRange_TestRangeTo end } BB16 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB17 { @@ -1823,7 +1823,7 @@ module IndexRange_TestRangeTo end } BB21 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB22 { @@ -1845,9 +1845,9 @@ module IndexRange_TestRangeTo end } BB25 { - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _44 }; - assume { Resolve0.resolve arr }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _44 }; + assume { Resolve1.resolve arr }; absurd } BB26 { @@ -1871,15 +1871,15 @@ module IndexRange_TestRangeTo goto BB29 } BB29 { - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _44 }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _44 }; switch (not ([#"../index_range.rs" 104 12 104 21] Slice.get ( * s1) _63 = ([#"../index_range.rs" 104 20 104 21] (1 : int32)))) | False -> goto BB31 | True -> goto BB30 end } BB30 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB31 { @@ -1892,7 +1892,7 @@ module IndexRange_TestRangeTo end } BB33 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB34 { @@ -1906,7 +1906,7 @@ module IndexRange_TestRangeTo end } BB36 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB37 { @@ -1920,7 +1920,7 @@ module IndexRange_TestRangeTo end } BB39 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB40 { @@ -1934,7 +1934,7 @@ module IndexRange_TestRangeTo end } BB42 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB43 { @@ -1948,7 +1948,7 @@ module IndexRange_TestRangeTo end } BB45 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB46 { @@ -1956,7 +1956,7 @@ module IndexRange_TestRangeTo goto BB47 } BB47 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; switch (not ([#"../index_range.rs" 111 12 111 23] _105 = ([#"../index_range.rs" 111 22 111 23] (4 : int32)))) | False -> goto BB49 | True -> goto BB48 @@ -2104,6 +2104,8 @@ module IndexRange_TestRangeFrom type t = int32, val Max0.mAX' = Max0.mAX', axiom . + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with + type t = int32 clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue1 with type t = int32 clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds1 with @@ -2124,8 +2126,6 @@ module IndexRange_TestRangeFrom type ShallowModelTy0.shallowModelTy = Seq.seq int32, function ShallowModel0.shallow_model = ShallowModel0.shallow_model use Core_Option_Option_Type as Core_Option_Option_Type - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with - type t = int32 clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel2 with type t = slice int32, type ShallowModelTy0.shallowModelTy = Seq.seq int32, @@ -2144,7 +2144,13 @@ module IndexRange_TestRangeFrom type t = int32, type s = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve1 with + type t = int32, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve2.resolve, + val Max0.mAX' = Max0.mAX' + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = int32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2156,9 +2162,9 @@ module IndexRange_TestRangeFrom type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = slice int32 - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = int32, type i = Core_Ops_Range_RangeFrom_Type.t_rangefrom usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2178,21 +2184,15 @@ module IndexRange_TestRangeFrom predicate InBounds0.in_bounds = InBounds0.in_bounds, type Output0.output = slice int32, predicate HasValue0.has_value = HasValue0.has_value - clone Alloc_Vec_Impl9_Deref_Interface as Deref0 with + clone Alloc_Vec_Impl8_Deref_Interface as Deref0 with type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, function ShallowModel1.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve0 with - type t = int32, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve2.resolve, - val Max0.mAX' = Max0.mAX' clone Core_Slice_Impl0_Len_Interface as Len0 with type t = int32, function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = int32, type i = Core_Ops_Range_RangeFrom_Type.t_rangefrom usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2296,7 +2296,7 @@ module IndexRange_TestRangeFrom goto BB5 } BB12 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB13 { @@ -2313,7 +2313,7 @@ module IndexRange_TestRangeFrom end } BB16 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB17 { @@ -2333,7 +2333,7 @@ module IndexRange_TestRangeFrom end } BB21 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB22 { @@ -2353,7 +2353,7 @@ module IndexRange_TestRangeFrom end } BB26 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB27 { @@ -2375,9 +2375,9 @@ module IndexRange_TestRangeFrom end } BB30 { - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _54 }; - assume { Resolve0.resolve arr }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _54 }; + assume { Resolve1.resolve arr }; absurd } BB31 { @@ -2401,15 +2401,15 @@ module IndexRange_TestRangeFrom goto BB34 } BB34 { - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _54 }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _54 }; switch (not ([#"../index_range.rs" 143 12 143 21] Slice.get ( * s1) _73 = ([#"../index_range.rs" 143 20 143 21] (4 : int32)))) | False -> goto BB36 | True -> goto BB35 end } BB35 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB36 { @@ -2422,7 +2422,7 @@ module IndexRange_TestRangeFrom end } BB38 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB39 { @@ -2436,7 +2436,7 @@ module IndexRange_TestRangeFrom end } BB41 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB42 { @@ -2450,7 +2450,7 @@ module IndexRange_TestRangeFrom end } BB44 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB45 { @@ -2464,7 +2464,7 @@ module IndexRange_TestRangeFrom end } BB47 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB48 { @@ -2478,7 +2478,7 @@ module IndexRange_TestRangeFrom end } BB50 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB51 { @@ -2486,7 +2486,7 @@ module IndexRange_TestRangeFrom goto BB52 } BB52 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; switch (not ([#"../index_range.rs" 150 12 150 23] _115 = ([#"../index_range.rs" 150 22 150 23] (4 : int32)))) | False -> goto BB54 | True -> goto BB53 @@ -2607,6 +2607,8 @@ module IndexRange_TestRangeFull type t = int32, val Max0.mAX' = Max0.mAX', axiom . + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with + type t = int32 clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue1 with type t = int32 clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds1 with @@ -2626,8 +2628,6 @@ module IndexRange_TestRangeFull type t = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq int32, function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with - type t = int32 clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel2 with type t = slice int32, type ShallowModelTy0.shallowModelTy = Seq.seq int32, @@ -2646,7 +2646,13 @@ module IndexRange_TestRangeFull type t = int32, type s = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve1 with + type t = int32, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve2.resolve, + val Max0.mAX' = Max0.mAX' + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = int32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2658,9 +2664,9 @@ module IndexRange_TestRangeFull type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = slice int32 - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = int32, type i = Core_Ops_Range_RangeFull_Type.t_rangefull, type a = Alloc_Alloc_Global_Type.t_global, @@ -2671,16 +2677,10 @@ module IndexRange_TestRangeFull predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere0.resolve_elswhere, type Output0.output = slice int32, val Max0.mAX' = Max0.mAX' - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve0 with - type t = int32, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve2.resolve, - val Max0.mAX' = Max0.mAX' clone Core_Slice_Impl0_Len_Interface as Len0 with type t = int32, function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = int32, type i = Core_Ops_Range_RangeFull_Type.t_rangefull, type a = Alloc_Alloc_Global_Type.t_global, @@ -2848,7 +2848,7 @@ module IndexRange_TestRangeFull goto BB5 } BB24 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB25 { @@ -2870,9 +2870,9 @@ module IndexRange_TestRangeFull end } BB28 { - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _43 }; - assume { Resolve0.resolve arr }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _43 }; + assume { Resolve1.resolve arr }; absurd } BB29 { @@ -2890,8 +2890,8 @@ module IndexRange_TestRangeFull } BB31 { s1 <- { s1 with current = Slice.set ( * s1) _55 ([#"../index_range.rs" 168 11 168 13] (-1 : int32)) }; - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _43 }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _43 }; goto BB32 } BB32 { @@ -2901,7 +2901,7 @@ module IndexRange_TestRangeFull end } BB33 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB34 { @@ -2915,7 +2915,7 @@ module IndexRange_TestRangeFull end } BB36 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB37 { @@ -2929,7 +2929,7 @@ module IndexRange_TestRangeFull end } BB39 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB40 { @@ -2943,7 +2943,7 @@ module IndexRange_TestRangeFull end } BB42 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB43 { @@ -2957,7 +2957,7 @@ module IndexRange_TestRangeFull end } BB45 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB46 { @@ -2965,7 +2965,7 @@ module IndexRange_TestRangeFull goto BB47 } BB47 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; switch (not ([#"../index_range.rs" 175 12 175 23] _96 = ([#"../index_range.rs" 175 22 175 23] (4 : int32)))) | False -> goto BB49 | True -> goto BB48 @@ -3117,6 +3117,8 @@ module IndexRange_TestRangeToInclusive type t = int32, val Max0.mAX' = Max0.mAX', axiom . + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with + type t = int32 clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue1 with type t = int32 clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds1 with @@ -3137,8 +3139,6 @@ module IndexRange_TestRangeToInclusive type ShallowModelTy0.shallowModelTy = Seq.seq int32, function ShallowModel0.shallow_model = ShallowModel0.shallow_model use Core_Option_Option_Type as Core_Option_Option_Type - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve2 with - type t = int32 clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel2 with type t = slice int32, type ShallowModelTy0.shallowModelTy = Seq.seq int32, @@ -3157,7 +3157,13 @@ module IndexRange_TestRangeToInclusive type t = int32, type s = Alloc_Vec_Vec_Type.t_vec int32 (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve1 with + type t = int32, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve2.resolve, + val Max0.mAX' = Max0.mAX' + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = int32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -3169,9 +3175,9 @@ module IndexRange_TestRangeToInclusive type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = slice int32 - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = int32, type i = Core_Ops_Range_RangeToInclusive_Type.t_rangetoinclusive usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -3191,21 +3197,15 @@ module IndexRange_TestRangeToInclusive predicate InBounds0.in_bounds = InBounds0.in_bounds, type Output0.output = slice int32, predicate HasValue0.has_value = HasValue0.has_value - clone Alloc_Vec_Impl9_Deref_Interface as Deref0 with + clone Alloc_Vec_Impl8_Deref_Interface as Deref0 with type t = int32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, function ShallowModel1.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve0 with - type t = int32, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve2.resolve, - val Max0.mAX' = Max0.mAX' clone Core_Slice_Impl0_Len_Interface as Len0 with type t = int32, function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = int32, type i = Core_Ops_Range_RangeToInclusive_Type.t_rangetoinclusive usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -3307,7 +3307,7 @@ module IndexRange_TestRangeToInclusive goto BB5 } BB12 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB13 { @@ -3327,7 +3327,7 @@ module IndexRange_TestRangeToInclusive end } BB17 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB18 { @@ -3349,9 +3349,9 @@ module IndexRange_TestRangeToInclusive end } BB21 { - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _35 }; - assume { Resolve0.resolve arr }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _35 }; + assume { Resolve1.resolve arr }; absurd } BB22 { @@ -3375,15 +3375,15 @@ module IndexRange_TestRangeToInclusive goto BB25 } BB25 { - assume { Resolve1.resolve s1 }; - assume { Resolve1.resolve _35 }; + assume { Resolve0.resolve s1 }; + assume { Resolve0.resolve _35 }; switch (not ([#"../index_range.rs" 200 12 200 21] Slice.get ( * s1) _54 = ([#"../index_range.rs" 200 20 200 21] (1 : int32)))) | False -> goto BB27 | True -> goto BB26 end } BB26 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB27 { @@ -3396,7 +3396,7 @@ module IndexRange_TestRangeToInclusive end } BB29 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB30 { @@ -3410,7 +3410,7 @@ module IndexRange_TestRangeToInclusive end } BB32 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB33 { @@ -3424,7 +3424,7 @@ module IndexRange_TestRangeToInclusive end } BB35 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB36 { @@ -3438,7 +3438,7 @@ module IndexRange_TestRangeToInclusive end } BB38 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB39 { @@ -3452,7 +3452,7 @@ module IndexRange_TestRangeToInclusive end } BB41 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; absurd } BB42 { @@ -3460,7 +3460,7 @@ module IndexRange_TestRangeToInclusive goto BB43 } BB43 { - assume { Resolve0.resolve arr }; + assume { Resolve1.resolve arr }; switch (not ([#"../index_range.rs" 207 12 207 23] _96 = ([#"../index_range.rs" 207 22 207 23] (4 : int32)))) | False -> goto BB45 | True -> goto BB44 diff --git a/creusot/tests/should_succeed/index_range/why3session.xml b/creusot/tests/should_succeed/index_range/why3session.xml index 20a6438f44..93d1dcc5f6 100644 --- a/creusot/tests/should_succeed/index_range/why3session.xml +++ b/creusot/tests/should_succeed/index_range/why3session.xml @@ -14,7 +14,7 @@ - + @@ -29,49 +29,49 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -89,49 +89,49 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -158,10 +158,10 @@ - + - + @@ -176,46 +176,46 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -224,7 +224,7 @@ - + @@ -248,25 +248,25 @@ - + - + - + - + - + @@ -275,10 +275,10 @@ - + - + @@ -287,31 +287,31 @@ - + - + - + - + - + - + - + - + - + @@ -320,14 +320,14 @@ - + - + @@ -349,25 +349,25 @@ - + - + - + - + - + @@ -385,31 +385,31 @@ - + - + - + - + - + - + - + - + - + diff --git a/creusot/tests/should_succeed/index_range/why3shapes.gz b/creusot/tests/should_succeed/index_range/why3shapes.gz index b2a43d7e04..af99bc800e 100644 Binary files a/creusot/tests/should_succeed/index_range/why3shapes.gz and b/creusot/tests/should_succeed/index_range/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/ite_normalize.mlcfg b/creusot/tests/should_succeed/ite_normalize.mlcfg index 308c972b75..d5a5ca3772 100644 --- a/creusot/tests/should_succeed/ite_normalize.mlcfg +++ b/creusot/tests/should_succeed/ite_normalize.mlcfg @@ -274,13 +274,6 @@ module IteNormalize_Expr_Type | C_True | C_False - let function var_v (self : t_expr) : usize = [@vc:do_not_keep_trace] [@vc:sp] - match (self) with - | C_IfThenElse _ _ _ -> any usize - | C_Var a -> a - | C_True -> any usize - | C_False -> any usize - end let function ifthenelse_c (self : t_expr) : t_expr = [@vc:do_not_keep_trace] [@vc:sp] match (self) with | C_IfThenElse a _ _ -> a @@ -302,14 +295,13 @@ module IteNormalize_Expr_Type | C_True -> any t_expr | C_False -> any t_expr end -end -module Core_Clone_Impls_Impl5_Clone_Interface - use prelude.Borrow - use prelude.Int - use prelude.UIntSize - val clone' (self : usize) : usize - ensures { [#"../../../../creusot-contracts/src/std/clone.rs" 7 0 20 1] result = self } - + let function var_v (self : t_expr) : usize = [@vc:do_not_keep_trace] [@vc:sp] + match (self) with + | C_IfThenElse _ _ _ -> any usize + | C_Var a -> a + | C_True -> any usize + | C_False -> any usize + end end module Alloc_Boxed_Impl12_Clone_Interface type t @@ -318,6 +310,14 @@ module Alloc_Boxed_Impl12_Clone_Interface val clone' (self : t) : t ensures { [#"../ite_normalize.rs" 68 0 77 1] result = self } +end +module Core_Clone_Impls_Impl5_Clone_Interface + use prelude.Borrow + use prelude.Int + use prelude.UIntSize + val clone' (self : usize) : usize + ensures { [#"../../../../creusot-contracts/src/std/clone.rs" 7 0 20 1] result = self } + end module Alloc_Alloc_Global_Type type t_global = @@ -336,11 +336,11 @@ module IteNormalize_Impl6_Clone use prelude.Int use prelude.UIntSize use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type + clone Core_Clone_Impls_Impl5_Clone_Interface as Clone1 use IteNormalize_Expr_Type as IteNormalize_Expr_Type - clone Alloc_Boxed_Impl12_Clone_Interface as Clone1 with + clone Alloc_Boxed_Impl12_Clone_Interface as Clone0 with type t = IteNormalize_Expr_Type.t_expr, type a = Alloc_Alloc_Global_Type.t_global - clone Core_Clone_Impls_Impl5_Clone_Interface as Clone0 let rec cfg clone' [#"../ite_normalize.rs" 55 9 55 14] [@cfg:stackify] [@cfg:subregion_analysis] (self : IteNormalize_Expr_Type.t_expr) : IteNormalize_Expr_Type.t_expr ensures { [#"../ite_normalize.rs" 55 9 55 14] result = self } @@ -398,7 +398,7 @@ module IteNormalize_Impl6_Clone goto BB9 } BB9 { - _0 <- IteNormalize_Expr_Type.C_IfThenElse ([#"../ite_normalize.rs" 55 9 55 14] Clone1.clone' _9) ([#"../ite_normalize.rs" 55 9 55 14] Clone1.clone' _12) ([#"../ite_normalize.rs" 55 9 55 14] Clone1.clone' _15); + _0 <- IteNormalize_Expr_Type.C_IfThenElse ([#"../ite_normalize.rs" 55 9 55 14] Clone0.clone' _9) ([#"../ite_normalize.rs" 55 9 55 14] Clone0.clone' _12) ([#"../ite_normalize.rs" 55 9 55 14] Clone0.clone' _15); goto BB10 } BB10 { @@ -416,7 +416,7 @@ module IteNormalize_Impl6_Clone goto BB14 } BB14 { - _0 <- IteNormalize_Expr_Type.C_Var ([#"../ite_normalize.rs" 55 9 55 14] Clone0.clone' _19); + _0 <- IteNormalize_Expr_Type.C_Var ([#"../ite_normalize.rs" 55 9 55 14] Clone1.clone' _19); goto BB16 } BB15 { @@ -783,9 +783,9 @@ module IteNormalize_Impl5_Normalize use prelude.Borrow use IteNormalize_Expr_Type as IteNormalize_Expr_Type clone IteNormalize_Impl5_IsNormalized as IsNormalized0 + clone IteNormalize_Impl6_Clone_Interface as Clone0 clone IteNormalize_Impl5_Transpose_Interface as Transpose0 with predicate IsNormalized0.is_normalized = IsNormalized0.is_normalized - clone IteNormalize_Impl6_Clone_Interface as Clone0 let rec cfg normalize [#"../ite_normalize.rs" 145 4 145 35] [@cfg:stackify] [@cfg:subregion_analysis] (self : IteNormalize_Expr_Type.t_expr) : IteNormalize_Expr_Type.t_expr ensures { [#"../ite_normalize.rs" 143 14 143 36] IsNormalized0.is_normalized result } variant {[#"../ite_normalize.rs" 144 14 144 18] self} diff --git a/creusot/tests/should_succeed/ite_normalize/why3session.xml b/creusot/tests/should_succeed/ite_normalize/why3session.xml index 6471090b1d..17a3b93617 100644 --- a/creusot/tests/should_succeed/ite_normalize/why3session.xml +++ b/creusot/tests/should_succeed/ite_normalize/why3session.xml @@ -18,7 +18,7 @@ - + diff --git a/creusot/tests/should_succeed/ite_normalize/why3shapes.gz b/creusot/tests/should_succeed/ite_normalize/why3shapes.gz index 8e8e892bdb..234807e91b 100644 Binary files a/creusot/tests/should_succeed/ite_normalize/why3shapes.gz and b/creusot/tests/should_succeed/ite_normalize/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/01_range.mlcfg b/creusot/tests/should_succeed/iterators/01_range.mlcfg index 28b09fc1ed..e85d3ff7de 100644 --- a/creusot/tests/should_succeed/iterators/01_range.mlcfg +++ b/creusot/tests/should_succeed/iterators/01_range.mlcfg @@ -467,8 +467,8 @@ module C01Range_Impl1 clone C01Range_Impl1_Completed as Completed0 with predicate Resolve0.resolve = Resolve0.resolve clone C01Range_Impl1_Produces as Produces0 - goal produces_trans_refn : [#"../01_range.rs" 53 4 53 90] forall a : C01Range_Range_Type.t_range . forall ab : Seq.seq isize . forall b : C01Range_Range_Type.t_range . forall bc : Seq.seq isize . forall c : C01Range_Range_Type.t_range . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) goal produces_refl_refn : [#"../01_range.rs" 46 4 46 29] forall a : C01Range_Range_Type.t_range . Inv0.inv a -> (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal produces_trans_refn : [#"../01_range.rs" 53 4 53 90] forall a : C01Range_Range_Type.t_range . forall ab : Seq.seq isize . forall b : C01Range_Range_Type.t_range . forall bc : Seq.seq isize . forall c : C01Range_Range_Type.t_range . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) goal next_refn : [#"../01_range.rs" 59 4 59 39] forall self : borrowed (C01Range_Range_Type.t_range) . Inv1.inv self -> (forall result : Core_Option_Option_Type.t_option isize . match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) diff --git a/creusot/tests/should_succeed/iterators/02_iter_mut.mlcfg b/creusot/tests/should_succeed/iterators/02_iter_mut.mlcfg index 02bb8b4e56..1b4ed996c3 100644 --- a/creusot/tests/should_succeed/iterators/02_iter_mut.mlcfg +++ b/creusot/tests/should_succeed/iterators/02_iter_mut.mlcfg @@ -1008,7 +1008,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -1218,7 +1218,7 @@ module C02IterMut_IterMut type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = slice t - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = t, type i = Core_Ops_Range_RangeFull_Type.t_rangefull, type a = Alloc_Alloc_Global_Type.t_global, @@ -1407,9 +1407,9 @@ module C02IterMut_AllZero type ShallowModelTy0.shallowModelTy = Seq.seq usize, function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = usize - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = usize use Core_Option_Option_Type as Core_Option_Option_Type clone C02IterMut_Impl1_Next_Interface as Next0 with type t = usize, @@ -1490,14 +1490,14 @@ module C02IterMut_AllZero } BB8 { _0 <- (); - assume { Resolve0.resolve v }; + assume { Resolve1.resolve v }; return _0 } BB9 { goto BB11 } BB10 { - assume { Resolve0.resolve v }; + assume { Resolve1.resolve v }; absurd } BB11 { @@ -1510,7 +1510,7 @@ module C02IterMut_AllZero produced <- _19; _19 <- any Ghost.ghost_ty (Seq.seq (borrowed usize)); x <- { x with current = ([#"../02_iter_mut.rs" 89 21 89 22] (0 : usize)) }; - assume { Resolve1.resolve x }; + assume { Resolve0.resolve x }; goto BB5 } diff --git a/creusot/tests/should_succeed/iterators/02_iter_mut/why3session.xml b/creusot/tests/should_succeed/iterators/02_iter_mut/why3session.xml index f85ed4b9a7..7549b3d8b5 100644 --- a/creusot/tests/should_succeed/iterators/02_iter_mut/why3session.xml +++ b/creusot/tests/should_succeed/iterators/02_iter_mut/why3session.xml @@ -52,16 +52,16 @@ - + - + - + diff --git a/creusot/tests/should_succeed/iterators/02_iter_mut/why3shapes.gz b/creusot/tests/should_succeed/iterators/02_iter_mut/why3shapes.gz index 5c2e4ea266..7715f7b6b9 100644 Binary files a/creusot/tests/should_succeed/iterators/02_iter_mut/why3shapes.gz and b/creusot/tests/should_succeed/iterators/02_iter_mut/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/03_std_iterators.mlcfg b/creusot/tests/should_succeed/iterators/03_std_iterators.mlcfg index b482de2599..e1dc2785fd 100644 --- a/creusot/tests/should_succeed/iterators/03_std_iterators.mlcfg +++ b/creusot/tests/should_succeed/iterators/03_std_iterators.mlcfg @@ -734,9 +734,9 @@ module C03StdIterators_SliceIter clone CreusotContracts_Std1_Iter_Impl0_IntoIterPre as IntoIterPre0 with type i = Core_Slice_Iter_Iter_Type.t_iter t clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with - type self = t - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with type self = Core_Slice_Iter_Iter_Type.t_iter t + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with + type self = t use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with type self = Core_Option_Option_Type.t_option t @@ -824,7 +824,7 @@ module C03StdIterators_SliceIter } BB8 { assume { Resolve4.resolve _17 }; - assume { Resolve5.resolve iter }; + assume { Resolve6.resolve iter }; _0 <- i; return _0 } @@ -833,7 +833,7 @@ module C03StdIterators_SliceIter } BB10 { assume { Resolve4.resolve _17 }; - assume { Resolve5.resolve iter }; + assume { Resolve6.resolve iter }; absurd } BB11 { @@ -846,7 +846,7 @@ module C03StdIterators_SliceIter produced <- _22; _22 <- any Ghost.ghost_ty (Seq.seq t); assume { Resolve2.resolve produced }; - assume { Resolve6.resolve __creusot_proc_iter_elem }; + assume { Resolve5.resolve __creusot_proc_iter_elem }; i <- ([#"../03_std_iterators.rs" 10 8 10 14] i + ([#"../03_std_iterators.rs" 10 13 10 14] (1 : usize))); goto BB5 } @@ -950,7 +950,7 @@ module CreusotContracts_Std1_Vec_Impl4_IntoIterPost ensures { result = into_iter_post self res } end -module Alloc_Vec_Impl17_IntoIter_Interface +module Alloc_Vec_Impl16_IntoIter_Interface type t type a use prelude.Borrow @@ -1111,9 +1111,9 @@ module C03StdIterators_VecIter type t = t, type a = Alloc_Alloc_Global_Type.t_global clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with - type self = t - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with type self = Core_Slice_Iter_Iter_Type.t_iter t + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with + type self = t use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with type self = Core_Option_Option_Type.t_option t @@ -1126,7 +1126,7 @@ module C03StdIterators_VecIter type self = Ghost.ghost_ty (Seq.seq t) clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = Ghost.ghost_ty (Core_Slice_Iter_Iter_Type.t_iter t) - clone Alloc_Vec_Impl17_IntoIter_Interface as IntoIter0 with + clone Alloc_Vec_Impl16_IntoIter_Interface as IntoIter0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, predicate IntoIterPre0.into_iter_pre = IntoIterPre0.into_iter_pre, @@ -1196,7 +1196,7 @@ module C03StdIterators_VecIter } BB7 { assume { Resolve4.resolve _16 }; - assume { Resolve5.resolve iter }; + assume { Resolve6.resolve iter }; _0 <- i; return _0 } @@ -1205,7 +1205,7 @@ module C03StdIterators_VecIter } BB9 { assume { Resolve4.resolve _16 }; - assume { Resolve5.resolve iter }; + assume { Resolve6.resolve iter }; absurd } BB10 { @@ -1218,7 +1218,7 @@ module C03StdIterators_VecIter produced <- _21; _21 <- any Ghost.ghost_ty (Seq.seq t); assume { Resolve2.resolve produced }; - assume { Resolve6.resolve __creusot_proc_iter_elem }; + assume { Resolve5.resolve __creusot_proc_iter_elem }; i <- ([#"../03_std_iterators.rs" 21 8 21 14] i + ([#"../03_std_iterators.rs" 21 13 21 14] (1 : usize))); goto BB4 } @@ -1470,7 +1470,7 @@ module CreusotContracts_Std1_Slice_Impl19_Resolve ensures { result = resolve self } end -module Alloc_Vec_Impl10_DerefMut_Interface +module Alloc_Vec_Impl9_DerefMut_Interface type t type a use prelude.Borrow @@ -1868,14 +1868,14 @@ module C03StdIterators_AllZero type ShallowModelTy0.shallowModelTy = Seq.seq usize, function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with - type t = usize - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Std1_Slice_Impl19_Resolve as Resolve2 with + clone CreusotContracts_Std1_Slice_Impl19_Resolve as Resolve3 with type t = usize, function ShallowModel0.shallow_model = ShallowModel4.shallow_model, function ShallowModel1.shallow_model = ShallowModel3.shallow_model, val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = usize use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Slice_Iter_Impl189_Next_Interface as Next0 with type t = usize, @@ -1899,7 +1899,7 @@ module C03StdIterators_AllZero predicate Inv0.inv = Inv0.inv, function ShallowModel1.shallow_model = ShallowModel3.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl10_DerefMut_Interface as DerefMut0 with + clone Alloc_Vec_Impl9_DerefMut_Interface as DerefMut0 with type t = usize, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, @@ -1981,17 +1981,17 @@ module C03StdIterators_AllZero end } BB9 { - assume { Resolve2.resolve iter }; + assume { Resolve3.resolve iter }; _0 <- (); - assume { Resolve3.resolve v }; + assume { Resolve4.resolve v }; return _0 } BB10 { goto BB12 } BB11 { - assume { Resolve2.resolve iter }; - assume { Resolve3.resolve v }; + assume { Resolve3.resolve iter }; + assume { Resolve4.resolve v }; absurd } BB12 { @@ -2006,7 +2006,7 @@ module C03StdIterators_AllZero x <- __creusot_proc_iter_elem; __creusot_proc_iter_elem <- any borrowed usize; x <- { x with current = ([#"../03_std_iterators.rs" 31 13 31 14] (0 : usize)) }; - assume { Resolve4.resolve x }; + assume { Resolve2.resolve x }; goto BB6 } @@ -3134,7 +3134,7 @@ module CreusotContracts_Std1_Vec_Impl10_Resolve ensures { result = resolve self } end -module Alloc_Vec_Impl9_Deref_Interface +module Alloc_Vec_Impl8_Deref_Interface type t type a use prelude.Borrow @@ -4167,7 +4167,7 @@ module C03StdIterators_Counter clone Core_Slice_Impl0_Iter_Interface as Iter0 with type t = uint32, function ShallowModel0.shallow_model = ShallowModel3.shallow_model - clone Alloc_Vec_Impl9_Deref_Interface as Deref0 with + clone Alloc_Vec_Impl8_Deref_Interface as Deref0 with type t = uint32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel1.shallow_model, @@ -4709,32 +4709,6 @@ module CreusotContracts_Std1_Iter_Enumerate_Impl2_Produces val produces (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) (visited : Seq.seq (usize, Item0.item)) (o : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) : bool ensures { result = produces self visited o } -end -module CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve_Stub - type i - use Core_Iter_Adapters_Enumerate_Enumerate_Type as Core_Iter_Adapters_Enumerate_Enumerate_Type - predicate resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) -end -module CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve_Interface - type i - use Core_Iter_Adapters_Enumerate_Enumerate_Type as Core_Iter_Adapters_Enumerate_Enumerate_Type - predicate resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) - val resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve - type i - clone CreusotContracts_Resolve_Resolve_Resolve_Stub as Resolve0 with - type self = i - use Core_Iter_Adapters_Enumerate_Enumerate_Type as Core_Iter_Adapters_Enumerate_Enumerate_Type - clone CreusotContracts_Std1_Iter_Enumerate_Impl0_Iter_Stub as Iter0 with - type i = i - predicate resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) = - [#"../../../../../creusot-contracts/src/std/iter/enumerate.rs" 33 12 33 33] Resolve0.resolve (Iter0.iter self) - val resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) : bool - ensures { result = resolve self } - end module CreusotContracts_Resolve_Impl0_Resolve_Stub type t1 @@ -4761,6 +4735,32 @@ module CreusotContracts_Resolve_Impl0_Resolve val resolve (self : (t1, t2)) : bool ensures { result = resolve self } +end +module CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve_Stub + type i + use Core_Iter_Adapters_Enumerate_Enumerate_Type as Core_Iter_Adapters_Enumerate_Enumerate_Type + predicate resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) +end +module CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve_Interface + type i + use Core_Iter_Adapters_Enumerate_Enumerate_Type as Core_Iter_Adapters_Enumerate_Enumerate_Type + predicate resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) + val resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve + type i + clone CreusotContracts_Resolve_Resolve_Resolve_Stub as Resolve0 with + type self = i + use Core_Iter_Adapters_Enumerate_Enumerate_Type as Core_Iter_Adapters_Enumerate_Enumerate_Type + clone CreusotContracts_Std1_Iter_Enumerate_Impl0_Iter_Stub as Iter0 with + type i = i + predicate resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) = + [#"../../../../../creusot-contracts/src/std/iter/enumerate.rs" 33 12 33 33] Resolve0.resolve (Iter0.iter self) + val resolve (self : Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate i) : bool + ensures { result = resolve self } + end module Core_Iter_Traits_Iterator_Iterator_Enumerate_Interface type self @@ -5053,9 +5053,9 @@ module C03StdIterators_EnumerateRange predicate Inv1.inv = Inv4.inv, axiom . clone CreusotContracts_Resolve_Impl2_Resolve as Resolve4 with - type t = usize - clone CreusotContracts_Resolve_Impl2_Resolve as Resolve3 with type t = Core_Ops_Range_Range_Type.t_range usize + clone CreusotContracts_Resolve_Impl2_Resolve as Resolve3 with + type t = usize clone CreusotContracts_Std1_Iter_Enumerate_Impl0_Iter_Interface as Iter0 with type i = Core_Ops_Range_Range_Type.t_range usize clone CreusotContracts_Std1_Iter_Enumerate_Impl2_Completed as Completed0 with @@ -5092,15 +5092,15 @@ module C03StdIterators_EnumerateRange type i = Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate (Core_Ops_Range_Range_Type.t_range usize) clone CreusotContracts_Std1_Iter_Impl0_IntoIterPre as IntoIterPre0 with type i = Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate (Core_Ops_Range_Range_Type.t_range usize) - clone CreusotContracts_Resolve_Impl0_Resolve as Resolve2 with - type t1 = usize, - type t2 = usize, - predicate Resolve0.resolve = Resolve4.resolve, - predicate Resolve1.resolve = Resolve4.resolve - clone CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve as Resolve1 with + clone CreusotContracts_Std1_Iter_Enumerate_Impl3_Resolve as Resolve2 with type i = Core_Ops_Range_Range_Type.t_range usize, function Iter0.iter = Iter0.iter, - predicate Resolve0.resolve = Resolve3.resolve + predicate Resolve0.resolve = Resolve4.resolve + clone CreusotContracts_Resolve_Impl0_Resolve as Resolve1 with + type t1 = usize, + type t2 = usize, + predicate Resolve0.resolve = Resolve3.resolve, + predicate Resolve1.resolve = Resolve3.resolve use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = Core_Iter_Adapters_Enumerate_Enumerate_Type.t_enumerate (Core_Ops_Range_Range_Type.t_range usize) @@ -5184,7 +5184,7 @@ module C03StdIterators_EnumerateRange end } BB8 { - assume { Resolve1.resolve iter }; + assume { Resolve2.resolve iter }; _0 <- (); return _0 } @@ -5192,7 +5192,7 @@ module C03StdIterators_EnumerateRange goto BB11 } BB10 { - assume { Resolve1.resolve iter }; + assume { Resolve2.resolve iter }; absurd } BB11 { @@ -5205,9 +5205,9 @@ module C03StdIterators_EnumerateRange _17 <- any Ghost.ghost_ty (Seq.seq (usize, usize)); ix <- (let (a, _) = __creusot_proc_iter_elem in a); x <- (let (_, a) = __creusot_proc_iter_elem in a); - assume { Resolve2.resolve __creusot_proc_iter_elem }; + assume { Resolve1.resolve __creusot_proc_iter_elem }; _21 <- (ix, x); - assume { Resolve2.resolve _21 }; + assume { Resolve1.resolve _21 }; goto BB5 } diff --git a/creusot/tests/should_succeed/iterators/03_std_iterators/why3session.xml b/creusot/tests/should_succeed/iterators/03_std_iterators/why3session.xml index 5a27fea568..df0272e203 100644 --- a/creusot/tests/should_succeed/iterators/03_std_iterators/why3session.xml +++ b/creusot/tests/should_succeed/iterators/03_std_iterators/why3session.xml @@ -3,22 +3,23 @@ "http://why3.lri.fr/why3session.dtd"> + - + - + - + @@ -68,7 +69,7 @@ - + diff --git a/creusot/tests/should_succeed/iterators/03_std_iterators/why3shapes.gz b/creusot/tests/should_succeed/iterators/03_std_iterators/why3shapes.gz index cc672953a8..c4e1a4a643 100644 Binary files a/creusot/tests/should_succeed/iterators/03_std_iterators/why3shapes.gz and b/creusot/tests/should_succeed/iterators/03_std_iterators/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/04_skip.mlcfg b/creusot/tests/should_succeed/iterators/04_skip.mlcfg index 89a19d4cb9..a4277774ea 100644 --- a/creusot/tests/should_succeed/iterators/04_skip.mlcfg +++ b/creusot/tests/should_succeed/iterators/04_skip.mlcfg @@ -746,11 +746,11 @@ module C04Skip_Impl1_Next predicate Produces0.produces = Produces0.produces, predicate Resolve0.resolve = Resolve3.resolve, predicate Completed0.completed = Completed1.completed + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve5 with + type t = C04Skip_Skip_Type.t_skip i use Core_Option_Option_Type as Core_Option_Option_Type - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with type self = Core_Option_Option_Type.t_option Item0.item - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with - type t = C04Skip_Skip_Type.t_skip i clone C04Skip_Common_Iterator_Next_Interface as Next0 with type self = i, predicate Inv0.inv = Inv2.inv, @@ -837,7 +837,7 @@ module C04Skip_Impl1_Next end } BB7 { - assume { Resolve4.resolve self }; + assume { Resolve5.resolve self }; _0 <- r; r <- any Core_Option_Option_Type.t_option Item0.item; goto BB15 @@ -849,7 +849,7 @@ module C04Skip_Impl1_Next end } BB9 { - assume { Resolve4.resolve self }; + assume { Resolve5.resolve self }; _0 <- r; r <- any Core_Option_Option_Type.t_option Item0.item; goto BB15 @@ -861,7 +861,7 @@ module C04Skip_Impl1_Next x <- Core_Option_Option_Type.some_0 r; r <- (let Core_Option_Option_Type.C_Some a = r in Core_Option_Option_Type.C_Some (any Item0.item)); assume { Resolve3.resolve x }; - assume { Resolve5.resolve r }; + assume { Resolve4.resolve r }; _25 <- ([#"../04_skip.rs" 83 26 83 70] Ghost.new (Seq.(++) (Ghost.inner skipped) (Seq.singleton x))); goto BB12 } @@ -941,7 +941,7 @@ module C04Skip_Impl1 type Item0.item = Item0.item, predicate Produces0.produces = Produces1.produces, predicate Resolve0.resolve = Resolve0.resolve - goal produces_trans_refn : [#"../04_skip.rs" 62 4 62 90] forall a : C04Skip_Skip_Type.t_skip i . forall ab : Seq.seq Item0.item . forall b : C04Skip_Skip_Type.t_skip i . forall bc : Seq.seq Item0.item . forall c : C04Skip_Skip_Type.t_skip i . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal produces_refl_refn : [#"../04_skip.rs" 55 4 55 29] forall a : C04Skip_Skip_Type.t_skip i . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) goal next_refn : [#"../04_skip.rs" 68 4 68 41] forall self : borrowed (C04Skip_Skip_Type.t_skip i) . Inv1.inv self -> Inv1.inv self /\ (forall result : Core_Option_Option_Type.t_option Item0.item . Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) @@ -949,5 +949,5 @@ module C04Skip_Impl1 | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_refl_refn : [#"../04_skip.rs" 55 4 55 29] forall a : C04Skip_Skip_Type.t_skip i . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal produces_trans_refn : [#"../04_skip.rs" 62 4 62 90] forall a : C04Skip_Skip_Type.t_skip i . forall ab : Seq.seq Item0.item . forall b : C04Skip_Skip_Type.t_skip i . forall bc : Seq.seq Item0.item . forall c : C04Skip_Skip_Type.t_skip i . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) end diff --git a/creusot/tests/should_succeed/iterators/04_skip/why3session.xml b/creusot/tests/should_succeed/iterators/04_skip/why3session.xml index edc61d15ab..594170b84d 100644 --- a/creusot/tests/should_succeed/iterators/04_skip/why3session.xml +++ b/creusot/tests/should_succeed/iterators/04_skip/why3session.xml @@ -39,25 +39,25 @@ - + - + - + - + - + @@ -72,14 +72,14 @@ - - + + - - + + diff --git a/creusot/tests/should_succeed/iterators/04_skip/why3shapes.gz b/creusot/tests/should_succeed/iterators/04_skip/why3shapes.gz index 428787b02a..21b4804f69 100644 Binary files a/creusot/tests/should_succeed/iterators/04_skip/why3shapes.gz and b/creusot/tests/should_succeed/iterators/04_skip/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/05_map.mlcfg b/creusot/tests/should_succeed/iterators/05_map.mlcfg index 1a152bc197..d9db69f5da 100644 --- a/creusot/tests/should_succeed/iterators/05_map.mlcfg +++ b/creusot/tests/should_succeed/iterators/05_map.mlcfg @@ -2190,7 +2190,9 @@ module C05Map_Impl0_Next predicate Inv0.inv = Inv4.inv, predicate PostconditionMut0.postcondition_mut = PostconditionMut0.postcondition_mut, type Output0.output = b - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = C05Map_Map_Type.t_map i b f + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = Ghost.ghost_ty () clone C05Map_Impl1_ProducesOneInvariant as ProducesOneInvariant0 with type i = i, @@ -2202,8 +2204,6 @@ module C05Map_Impl0_Next predicate Inv2.inv = Inv0.inv, predicate Produces0.produces = Produces1.produces, axiom . - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = C05Map_Map_Type.t_map i b f clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = Core_Option_Option_Type.t_option Item0.item clone C05Map_Common_Iterator_Next_Interface as Next0 with @@ -2249,7 +2249,7 @@ module C05Map_Impl0_Next } BB2 { assume { Resolve0.resolve _5 }; - assume { Resolve1.resolve self }; + assume { Resolve2.resolve self }; _0 <- Core_Option_Option_Type.C_None; goto BB12 } @@ -2258,7 +2258,7 @@ module C05Map_Impl0_Next } BB4 { assume { Resolve0.resolve _5 }; - assume { Resolve1.resolve self }; + assume { Resolve2.resolve self }; absurd } BB5 { @@ -2273,7 +2273,7 @@ module C05Map_Impl0_Next goto BB7 } BB7 { - assume { Resolve2.resolve _11 }; + assume { Resolve1.resolve _11 }; _14 <- borrow_mut (C05Map_Map_Type.map_func ( * self)); self <- { self with current = (let C05Map_Map_Type.C_Map a b = * self in C05Map_Map_Type.C_Map a ( ^ _14)) }; goto BB8 @@ -2282,7 +2282,7 @@ module C05Map_Impl0_Next goto BB9 } BB9 { - assume { Resolve1.resolve self }; + assume { Resolve2.resolve self }; _0 <- Core_Option_Option_Type.C_Some ([#"../05_map.rs" 70 21 70 35] CallMut0.call_mut _14 (v)); _14 <- any borrowed f; v <- any Item0.item; @@ -2547,8 +2547,8 @@ module C05Map_Impl0 type i type b type f - use prelude.Borrow use seq.Seq + use prelude.Borrow clone C05Map_Common_Iterator_Item_Type as Item1 with type self = i clone CreusotContracts_Std1_Ops_Impl1_PostconditionMut_Interface as PostconditionMut0 with @@ -2622,24 +2622,27 @@ module C05Map_Impl0 predicate PreservationInv0.preservation_inv = PreservationInv0.preservation_inv, predicate NextPrecondition0.next_precondition = NextPrecondition0.next_precondition, predicate Preservation0.preservation = Preservation0.preservation - clone CreusotContracts_Invariant_Inv_Interface as Inv1 with + clone CreusotContracts_Invariant_Inv_Interface as Inv0 with type t = C05Map_Map_Type.t_map i b f + clone CreusotContracts_Invariant_Inv_Interface as Inv1 with + type t = borrowed (C05Map_Map_Type.t_map i b f) + clone TyInv_Borrow as TyInv_Borrow0 with + type t = C05Map_Map_Type.t_map i b f, + predicate Inv0.inv = Inv1.inv, + predicate Inv1.inv = Inv0.inv, + axiom . clone C05Map_Map_Type_Inv as C05Map_Map_Type_Inv0 with type i = i, type b = b, type f = f, - predicate Inv0.inv = Inv1.inv, + predicate Inv0.inv = Inv0.inv, predicate Invariant0.invariant' = Invariant0.invariant', predicate Inv1.inv = Inv2.inv, predicate Inv2.inv = Inv3.inv, axiom . - clone CreusotContracts_Invariant_Inv_Interface as Inv0 with - type t = borrowed (C05Map_Map_Type.t_map i b f) - clone TyInv_Borrow as TyInv_Borrow0 with - type t = C05Map_Map_Type.t_map i b f, - predicate Inv0.inv = Inv0.inv, - predicate Inv1.inv = Inv1.inv, - axiom . + clone C05Map_Common_Iterator_Item_Type as Item0 with + type self = C05Map_Map_Type.t_map i b f + use Core_Option_Option_Type as Core_Option_Option_Type clone C05Map_Impl0_Produces as Produces0 with type i = i, type b = b, @@ -2649,9 +2652,6 @@ module C05Map_Impl0 predicate Produces0.produces = Produces1.produces, predicate Precondition0.precondition = Precondition0.precondition, predicate PostconditionMut0.postcondition_mut = PostconditionMut0.postcondition_mut - clone C05Map_Common_Iterator_Item_Type as Item0 with - type self = C05Map_Map_Type.t_map i b f - use Core_Option_Option_Type as Core_Option_Option_Type clone C05Map_Impl1_ProducesOne as ProducesOne0 with type i = i, type b = b, @@ -2662,15 +2662,15 @@ module C05Map_Impl0 predicate Precondition0.precondition = Precondition0.precondition, predicate PostconditionMut0.postcondition_mut = PostconditionMut0.postcondition_mut, axiom . - goal next_refn : [#"../05_map.rs" 64 4 64 44] forall self : borrowed (C05Map_Map_Type.t_map i b f) . Inv0.inv self -> Inv0.inv self /\ Inv1.inv ( * self) /\ (forall result : Core_Option_Option_Type.t_option b . Inv1.inv ( ^ self) /\ Inv1.inv ( ^ self) /\ match (result) with + goal produces_trans_refn : [#"../05_map.rs" 39 4 39 90] forall a : C05Map_Map_Type.t_map i b f . forall ab : Seq.seq b . forall b : C05Map_Map_Type.t_map i b f . forall bc : Seq.seq b . forall c : C05Map_Map_Type.t_map i b f . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal next_refn : [#"../05_map.rs" 64 4 64 44] forall self : borrowed (C05Map_Map_Type.t_map i b f) . Inv1.inv self -> Inv1.inv self /\ Inv0.inv ( * self) /\ (forall result : Core_Option_Option_Type.t_option b . Inv0.inv ( ^ self) /\ Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> ProducesOne0.produces_one ( * self) v ( ^ self) - end -> Inv1.inv ( ^ self) /\ match (result) with + end -> Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_trans_refn : [#"../05_map.rs" 39 4 39 90] forall a : C05Map_Map_Type.t_map i b f . forall ab : Seq.seq b . forall b : C05Map_Map_Type.t_map i b f . forall bc : Seq.seq b . forall c : C05Map_Map_Type.t_map i b f . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) - goal produces_refl_refn : [#"../05_map.rs" 32 4 32 29] forall a : C05Map_Map_Type.t_map i b f . Inv1.inv a -> Inv1.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal produces_refl_refn : [#"../05_map.rs" 32 4 32 29] forall a : C05Map_Map_Type.t_map i b f . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) end module C05Map_Impl2 type i diff --git a/creusot/tests/should_succeed/iterators/05_map/why3session.xml b/creusot/tests/should_succeed/iterators/05_map/why3session.xml index 3e0c342cd1..8a62e1c81d 100644 --- a/creusot/tests/should_succeed/iterators/05_map/why3session.xml +++ b/creusot/tests/should_succeed/iterators/05_map/why3session.xml @@ -4,8 +4,8 @@ + - @@ -245,17 +245,17 @@ - + - + - + @@ -266,12 +266,12 @@ - - - + + + diff --git a/creusot/tests/should_succeed/iterators/05_map/why3shapes.gz b/creusot/tests/should_succeed/iterators/05_map/why3shapes.gz index 2f73038a38..0a9f628c73 100644 Binary files a/creusot/tests/should_succeed/iterators/05_map/why3shapes.gz and b/creusot/tests/should_succeed/iterators/05_map/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/05_take.mlcfg b/creusot/tests/should_succeed/iterators/05_take.mlcfg index 236faa6ed5..980624156f 100644 --- a/creusot/tests/should_succeed/iterators/05_take.mlcfg +++ b/creusot/tests/should_succeed/iterators/05_take.mlcfg @@ -674,54 +674,54 @@ module C05Take_Impl0_Next end module C05Take_Impl0 type i - use prelude.Borrow use seq.Seq + use prelude.Borrow clone CreusotContracts_Invariant_Inv_Interface as Inv2 with type t = i - clone C05Take_Common_Iterator_Item_Type as Item0 with - type self = i - clone C05Take_Common_Iterator_Produces_Interface as Produces1 with - type self = i, - type Item0.item = Item0.item clone C05Take_Common_Iterator_Completed_Interface as Completed1 with type self = i use C05Take_Take_Type as C05Take_Take_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = C05Take_Take_Type.t_take i - clone CreusotContracts_Invariant_Inv_Interface as Inv1 with - type t = C05Take_Take_Type.t_take i - clone C05Take_Take_Type_Inv as C05Take_Take_Type_Inv0 with - type i = i, - predicate Inv0.inv = Inv1.inv, - predicate Inv1.inv = Inv2.inv, - axiom . clone CreusotContracts_Invariant_Inv_Interface as Inv0 with + type t = C05Take_Take_Type.t_take i + clone CreusotContracts_Invariant_Inv_Interface as Inv1 with type t = borrowed (C05Take_Take_Type.t_take i) clone TyInv_Borrow as TyInv_Borrow0 with type t = C05Take_Take_Type.t_take i, + predicate Inv0.inv = Inv1.inv, + predicate Inv1.inv = Inv0.inv, + axiom . + clone C05Take_Common_Iterator_Item_Type as Item0 with + type self = i + clone C05Take_Common_Iterator_Produces_Interface as Produces1 with + type self = i, + type Item0.item = Item0.item + clone C05Take_Take_Type_Inv as C05Take_Take_Type_Inv0 with + type i = i, predicate Inv0.inv = Inv0.inv, - predicate Inv1.inv = Inv1.inv, + predicate Inv1.inv = Inv2.inv, axiom . clone C05Take_Common_Iterator_Item_Type as Item1 with type self = C05Take_Take_Type.t_take i use Core_Option_Option_Type as Core_Option_Option_Type - clone C05Take_Impl0_Produces as Produces0 with - type i = i, - type Item0.item = Item0.item, - predicate Produces0.produces = Produces1.produces clone C05Take_Impl0_Completed as Completed0 with type i = i, predicate Resolve0.resolve = Resolve0.resolve, predicate Completed0.completed = Completed1.completed - goal next_refn : [#"../05_take.rs" 53 4 53 41] forall self : borrowed (C05Take_Take_Type.t_take i) . Inv0.inv self -> Inv0.inv self /\ (forall result : Core_Option_Option_Type.t_option Item0.item . Inv1.inv ( ^ self) /\ match (result) with + clone C05Take_Impl0_Produces as Produces0 with + type i = i, + type Item0.item = Item0.item, + predicate Produces0.produces = Produces1.produces + goal produces_trans_refn : [#"../05_take.rs" 47 4 47 90] forall a : C05Take_Take_Type.t_take i . forall ab : Seq.seq Item0.item . forall b : C05Take_Take_Type.t_take i . forall bc : Seq.seq Item0.item . forall c : C05Take_Take_Type.t_take i . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal produces_refl_refn : [#"../05_take.rs" 40 4 40 29] forall a : C05Take_Take_Type.t_take i . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal next_refn : [#"../05_take.rs" 53 4 53 41] forall self : borrowed (C05Take_Take_Type.t_take i) . Inv1.inv self -> Inv1.inv self /\ (forall result : Core_Option_Option_Type.t_option Item0.item . Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) - end -> Inv1.inv ( ^ self) /\ match (result) with + end -> Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_trans_refn : [#"../05_take.rs" 47 4 47 90] forall a : C05Take_Take_Type.t_take i . forall ab : Seq.seq Item0.item . forall b : C05Take_Take_Type.t_take i . forall bc : Seq.seq Item0.item . forall c : C05Take_Take_Type.t_take i . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) - goal produces_refl_refn : [#"../05_take.rs" 40 4 40 29] forall a : C05Take_Take_Type.t_take i . Inv1.inv a -> Inv1.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) end module C05Take_Impl1 type i diff --git a/creusot/tests/should_succeed/iterators/05_take/why3session.xml b/creusot/tests/should_succeed/iterators/05_take/why3session.xml index 3dad5e9771..d07b7541a3 100644 --- a/creusot/tests/should_succeed/iterators/05_take/why3session.xml +++ b/creusot/tests/should_succeed/iterators/05_take/why3session.xml @@ -21,15 +21,15 @@ - - - + + + diff --git a/creusot/tests/should_succeed/iterators/05_take/why3shapes.gz b/creusot/tests/should_succeed/iterators/05_take/why3shapes.gz index 6567a21855..d2bc59aeca 100644 Binary files a/creusot/tests/should_succeed/iterators/05_take/why3shapes.gz and b/creusot/tests/should_succeed/iterators/05_take/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/06_map_precond.mlcfg b/creusot/tests/should_succeed/iterators/06_map_precond.mlcfg index d0385086e2..85d8148399 100644 --- a/creusot/tests/should_succeed/iterators/06_map_precond.mlcfg +++ b/creusot/tests/should_succeed/iterators/06_map_precond.mlcfg @@ -2338,7 +2338,9 @@ module C06MapPrecond_Impl0_Next predicate Precondition0.precondition = Precondition0.precondition, predicate PostconditionMut0.postcondition_mut = PostconditionMut0.postcondition_mut, axiom . - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = C06MapPrecond_Map_Type.t_map Item0.item i b f + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = Ghost.ghost_ty (Seq.seq Item0.item) use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Ops_Function_FnMut_CallMut_Interface as CallMut0 with @@ -2348,7 +2350,7 @@ module C06MapPrecond_Impl0_Next predicate Inv0.inv = Inv4.inv, predicate PostconditionMut0.postcondition_mut = PostconditionMut0.postcondition_mut, type Output0.output = b - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = Ghost.ghost_ty () clone C06MapPrecond_Impl1_ProducesOneInvariant as ProducesOneInvariant0 with type i = i, @@ -2361,8 +2363,6 @@ module C06MapPrecond_Impl0_Next type Item0.item = Item0.item, predicate Produces0.produces = Produces1.produces, axiom . - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = C06MapPrecond_Map_Type.t_map Item0.item i b f clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = Core_Option_Option_Type.t_option Item0.item clone C06MapPrecond_Common_Iterator_Next_Interface as Next0 with @@ -2420,7 +2420,7 @@ module C06MapPrecond_Impl0_Next } BB4 { assume { Resolve0.resolve _5 }; - assume { Resolve1.resolve self }; + assume { Resolve3.resolve self }; absurd } BB5 { @@ -2435,7 +2435,7 @@ module C06MapPrecond_Impl0_Next goto BB7 } BB7 { - assume { Resolve2.resolve _11 }; + assume { Resolve1.resolve _11 }; produced <- ([#"../06_map_precond.rs" 74 31 74 63] Ghost.new (Seq.snoc (Ghost.inner (C06MapPrecond_Map_Type.map_produced ( * self))) v)); goto BB8 } @@ -2461,8 +2461,8 @@ module C06MapPrecond_Impl0_Next BB12 { self <- { self with current = (let C06MapPrecond_Map_Type.C_Map a b c = * self in C06MapPrecond_Map_Type.C_Map a b produced) }; produced <- any Ghost.ghost_ty (Seq.seq Item0.item); - assume { Resolve3.resolve (C06MapPrecond_Map_Type.map_produced ( * self)) }; - assume { Resolve1.resolve self }; + assume { Resolve2.resolve (C06MapPrecond_Map_Type.map_produced ( * self)) }; + assume { Resolve3.resolve self }; _0 <- r; r <- any Core_Option_Option_Type.t_option b; goto BB13 @@ -2476,8 +2476,8 @@ module C06MapPrecond_Impl0_Next BB15 { self <- { self with current = (let C06MapPrecond_Map_Type.C_Map a b c = * self in C06MapPrecond_Map_Type.C_Map a b _23) }; _23 <- any Ghost.ghost_ty (Seq.seq Item0.item); - assume { Resolve3.resolve (C06MapPrecond_Map_Type.map_produced ( * self)) }; - assume { Resolve1.resolve self }; + assume { Resolve2.resolve (C06MapPrecond_Map_Type.map_produced ( * self)) }; + assume { Resolve3.resolve self }; _0 <- Core_Option_Option_Type.C_None; goto BB16 } @@ -3673,8 +3673,8 @@ module C06MapPrecond_Impl0 type i type b type f - use prelude.Borrow use seq.Seq + use prelude.Borrow use prelude.Ghost clone C06MapPrecond_Common_Iterator_Item_Type as Item0 with type self = i @@ -3754,25 +3754,28 @@ module C06MapPrecond_Impl0 predicate PreservationInv0.preservation_inv = PreservationInv0.preservation_inv, predicate NextPrecondition0.next_precondition = NextPrecondition0.next_precondition, predicate Preservation0.preservation = Preservation0.preservation - clone CreusotContracts_Invariant_Inv_Interface as Inv1 with + clone CreusotContracts_Invariant_Inv_Interface as Inv0 with type t = C06MapPrecond_Map_Type.t_map Item0.item i b f + clone CreusotContracts_Invariant_Inv_Interface as Inv1 with + type t = borrowed (C06MapPrecond_Map_Type.t_map Item0.item i b f) + clone TyInv_Borrow as TyInv_Borrow0 with + type t = C06MapPrecond_Map_Type.t_map Item0.item i b f, + predicate Inv0.inv = Inv1.inv, + predicate Inv1.inv = Inv0.inv, + axiom . clone C06MapPrecond_Map_Type_Inv as C06MapPrecond_Map_Type_Inv0 with type a = Item0.item, type i = i, type b = b, type f = f, - predicate Inv0.inv = Inv1.inv, + predicate Inv0.inv = Inv0.inv, predicate Invariant0.invariant' = Invariant0.invariant', predicate Inv1.inv = Inv2.inv, predicate Inv2.inv = Inv3.inv, axiom . - clone CreusotContracts_Invariant_Inv_Interface as Inv0 with - type t = borrowed (C06MapPrecond_Map_Type.t_map Item0.item i b f) - clone TyInv_Borrow as TyInv_Borrow0 with - type t = C06MapPrecond_Map_Type.t_map Item0.item i b f, - predicate Inv0.inv = Inv0.inv, - predicate Inv1.inv = Inv1.inv, - axiom . + clone C06MapPrecond_Common_Iterator_Item_Type as Item1 with + type self = C06MapPrecond_Map_Type.t_map Item0.item i b f + use Core_Option_Option_Type as Core_Option_Option_Type clone C06MapPrecond_Impl0_Produces as Produces0 with type i = i, type b = b, @@ -3782,9 +3785,6 @@ module C06MapPrecond_Impl0 predicate Produces0.produces = Produces1.produces, predicate Precondition0.precondition = Precondition0.precondition, predicate PostconditionMut0.postcondition_mut = PostconditionMut0.postcondition_mut - clone C06MapPrecond_Common_Iterator_Item_Type as Item1 with - type self = C06MapPrecond_Map_Type.t_map Item0.item i b f - use Core_Option_Option_Type as Core_Option_Option_Type clone C06MapPrecond_Impl1_ProducesOne as ProducesOne0 with type i = i, type b = b, @@ -3795,15 +3795,15 @@ module C06MapPrecond_Impl0 predicate Precondition0.precondition = Precondition0.precondition, predicate PostconditionMut0.postcondition_mut = PostconditionMut0.postcondition_mut, axiom . - goal next_refn : [#"../06_map_precond.rs" 69 4 69 44] forall self : borrowed (C06MapPrecond_Map_Type.t_map Item0.item i b f) . Inv0.inv self -> Inv0.inv self /\ Inv1.inv ( * self) /\ (forall result : Core_Option_Option_Type.t_option b . Inv1.inv ( ^ self) /\ Inv1.inv ( ^ self) /\ match (result) with + goal produces_refl_refn : [#"../06_map_precond.rs" 36 4 36 29] forall a : C06MapPrecond_Map_Type.t_map Item0.item i b f . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal next_refn : [#"../06_map_precond.rs" 69 4 69 44] forall self : borrowed (C06MapPrecond_Map_Type.t_map Item0.item i b f) . Inv1.inv self -> Inv1.inv self /\ Inv0.inv ( * self) /\ (forall result : Core_Option_Option_Type.t_option b . Inv0.inv ( ^ self) /\ Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> ProducesOne0.produces_one ( * self) v ( ^ self) - end -> Inv1.inv ( ^ self) /\ match (result) with + end -> Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_refl_refn : [#"../06_map_precond.rs" 36 4 36 29] forall a : C06MapPrecond_Map_Type.t_map Item0.item i b f . Inv1.inv a -> Inv1.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) - goal produces_trans_refn : [#"../06_map_precond.rs" 43 4 43 90] forall a : C06MapPrecond_Map_Type.t_map Item0.item i b f . forall ab : Seq.seq b . forall b : C06MapPrecond_Map_Type.t_map Item0.item i b f . forall bc : Seq.seq b . forall c : C06MapPrecond_Map_Type.t_map Item0.item i b f . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal produces_trans_refn : [#"../06_map_precond.rs" 43 4 43 90] forall a : C06MapPrecond_Map_Type.t_map Item0.item i b f . forall ab : Seq.seq b . forall b : C06MapPrecond_Map_Type.t_map Item0.item i b f . forall bc : Seq.seq b . forall c : C06MapPrecond_Map_Type.t_map Item0.item i b f . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) end module C06MapPrecond_Impl2 type i diff --git a/creusot/tests/should_succeed/iterators/06_map_precond/why3session.xml b/creusot/tests/should_succeed/iterators/06_map_precond/why3session.xml index a7da533d13..ff12fc1a6e 100644 --- a/creusot/tests/should_succeed/iterators/06_map_precond/why3session.xml +++ b/creusot/tests/should_succeed/iterators/06_map_precond/why3session.xml @@ -3,6 +3,7 @@ "http://why3.lri.fr/why3session.dtd"> + @@ -274,13 +275,13 @@ - + - + @@ -293,7 +294,7 @@ - + @@ -303,7 +304,7 @@ - + @@ -321,7 +322,7 @@ - + @@ -377,12 +378,12 @@ - - - + + + diff --git a/creusot/tests/should_succeed/iterators/06_map_precond/why3shapes.gz b/creusot/tests/should_succeed/iterators/06_map_precond/why3shapes.gz index 8de68e0526..3c46000cd0 100644 Binary files a/creusot/tests/should_succeed/iterators/06_map_precond/why3shapes.gz and b/creusot/tests/should_succeed/iterators/06_map_precond/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/07_fuse.mlcfg b/creusot/tests/should_succeed/iterators/07_fuse.mlcfg index 97087946bf..3d1236619d 100644 --- a/creusot/tests/should_succeed/iterators/07_fuse.mlcfg +++ b/creusot/tests/should_succeed/iterators/07_fuse.mlcfg @@ -1063,8 +1063,8 @@ module C07Fuse_Impl3_IsFused_Impl end module C07Fuse_Impl1 type i - use prelude.Borrow use seq.Seq + use prelude.Borrow use prelude.Ghost use prelude.Ghost clone CreusotContracts_Invariant_Inv_Interface as Inv3 with @@ -1086,47 +1086,47 @@ module C07Fuse_Impl1 predicate Inv1.inv = Inv3.inv, predicate Inv2.inv = Inv4.inv, axiom . + use C07Fuse_Fuse_Type as C07Fuse_Fuse_Type + clone CreusotContracts_Invariant_Inv_Interface as Inv0 with + type t = C07Fuse_Fuse_Type.t_fuse i + clone CreusotContracts_Invariant_Inv_Interface as Inv1 with + type t = borrowed (C07Fuse_Fuse_Type.t_fuse i) + clone TyInv_Borrow as TyInv_Borrow0 with + type t = C07Fuse_Fuse_Type.t_fuse i, + predicate Inv0.inv = Inv1.inv, + predicate Inv1.inv = Inv0.inv, + axiom . clone C07Fuse_Common_Iterator_Item_Type as Item0 with type self = i clone C07Fuse_Common_Iterator_Produces_Interface as Produces1 with type self = i, type Item0.item = Item0.item - use C07Fuse_Fuse_Type as C07Fuse_Fuse_Type clone C07Fuse_Impl0_Inner as Inner0 with type i = i - clone CreusotContracts_Invariant_Inv_Interface as Inv1 with - type t = C07Fuse_Fuse_Type.t_fuse i clone C07Fuse_Fuse_Type_Inv as C07Fuse_Fuse_Type_Inv0 with type i = i, - predicate Inv0.inv = Inv1.inv, - predicate Inv1.inv = Inv2.inv, - axiom . - clone CreusotContracts_Invariant_Inv_Interface as Inv0 with - type t = borrowed (C07Fuse_Fuse_Type.t_fuse i) - clone TyInv_Borrow as TyInv_Borrow0 with - type t = C07Fuse_Fuse_Type.t_fuse i, predicate Inv0.inv = Inv0.inv, - predicate Inv1.inv = Inv1.inv, + predicate Inv1.inv = Inv2.inv, axiom . clone C07Fuse_Common_Iterator_Item_Type as Item1 with type self = C07Fuse_Fuse_Type.t_fuse i use Core_Option_Option_Type as Core_Option_Option_Type + clone C07Fuse_Impl1_Completed as Completed0 with + type i = i clone C07Fuse_Impl1_Produces as Produces0 with type i = i, type Item0.item = Item0.item, function Inner0.inner = Inner0.inner, predicate Produces0.produces = Produces1.produces - clone C07Fuse_Impl1_Completed as Completed0 with - type i = i - goal next_refn : [#"../07_fuse.rs" 45 4 45 44] forall self : borrowed (C07Fuse_Fuse_Type.t_fuse i) . Inv0.inv self -> Inv0.inv self /\ (forall result : Core_Option_Option_Type.t_option Item0.item . Inv1.inv ( ^ self) /\ match (result) with + goal produces_refl_refn : [#"../07_fuse.rs" 61 4 61 29] forall a : C07Fuse_Fuse_Type.t_fuse i . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal next_refn : [#"../07_fuse.rs" 45 4 45 44] forall self : borrowed (C07Fuse_Fuse_Type.t_fuse i) . Inv1.inv self -> Inv1.inv self /\ (forall result : Core_Option_Option_Type.t_option Item0.item . Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) - end -> Inv1.inv ( ^ self) /\ match (result) with + end -> Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_trans_refn : [#"../07_fuse.rs" 68 4 68 90] forall a : C07Fuse_Fuse_Type.t_fuse i . forall ab : Seq.seq Item0.item . forall b : C07Fuse_Fuse_Type.t_fuse i . forall bc : Seq.seq Item0.item . forall c : C07Fuse_Fuse_Type.t_fuse i . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) - goal produces_refl_refn : [#"../07_fuse.rs" 61 4 61 29] forall a : C07Fuse_Fuse_Type.t_fuse i . Inv1.inv a -> Inv1.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal produces_trans_refn : [#"../07_fuse.rs" 68 4 68 90] forall a : C07Fuse_Fuse_Type.t_fuse i . forall ab : Seq.seq Item0.item . forall b : C07Fuse_Fuse_Type.t_fuse i . forall bc : Seq.seq Item0.item . forall c : C07Fuse_Fuse_Type.t_fuse i . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) end module C07Fuse_Impl2 type i diff --git a/creusot/tests/should_succeed/iterators/07_fuse/why3session.xml b/creusot/tests/should_succeed/iterators/07_fuse/why3session.xml index 1d09f8c994..d757fb65cb 100644 --- a/creusot/tests/should_succeed/iterators/07_fuse/why3session.xml +++ b/creusot/tests/should_succeed/iterators/07_fuse/why3session.xml @@ -43,15 +43,15 @@ + + + - - - diff --git a/creusot/tests/should_succeed/iterators/07_fuse/why3shapes.gz b/creusot/tests/should_succeed/iterators/07_fuse/why3shapes.gz index 534ca38605..ef4a5ab512 100644 Binary files a/creusot/tests/should_succeed/iterators/07_fuse/why3shapes.gz and b/creusot/tests/should_succeed/iterators/07_fuse/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/08_collect_extend.mlcfg b/creusot/tests/should_succeed/iterators/08_collect_extend.mlcfg index b8a862a42c..248634d5b3 100644 --- a/creusot/tests/should_succeed/iterators/08_collect_extend.mlcfg +++ b/creusot/tests/should_succeed/iterators/08_collect_extend.mlcfg @@ -676,16 +676,16 @@ module C08CollectExtend_Extend type i = i clone CreusotContracts_Std1_Iter_Iterator_Completed_Interface as Completed0 with type self = i + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve6 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with + type self = i clone Alloc_Vec_Impl1_Push_Interface as Push0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, function ShallowModel1.shallow_model = ShallowModel0.shallow_model, val Max0.mAX' = Max0.mAX' - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve6 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with - type self = i use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with type self = Core_Option_Option_Type.t_option t @@ -975,9 +975,12 @@ module C08CollectExtend_Collect predicate Inv0.inv = Inv1.inv, predicate Inv1.inv = Inv0.inv, axiom . - use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type clone Core_Iter_Traits_Iterator_Iterator_Item_Type as Item0 with type self = i + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with + type self = Item0.item + use seq.Seq + use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type clone Core_Num_Impl11_Max as Max0 clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel0 with @@ -985,17 +988,14 @@ module C08CollectExtend_Collect type a = Alloc_Alloc_Global_Type.t_global, val Max0.mAX' = Max0.mAX', axiom . - use seq.Seq - clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel1 with - type t = Alloc_Vec_Vec_Type.t_vec Item0.item (Alloc_Alloc_Global_Type.t_global), - type ShallowModelTy0.shallowModelTy = Seq.seq Item0.item, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with - type self = Item0.item clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with type t = Item0.item, type s = Alloc_Vec_Vec_Type.t_vec Item0.item (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model + clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel1 with + type t = Alloc_Vec_Vec_Type.t_vec Item0.item (Alloc_Alloc_Global_Type.t_global), + type ShallowModelTy0.shallowModelTy = Seq.seq Item0.item, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone CreusotContracts_Std1_Iter_Iterator_Produces_Interface as Produces0 with type self = i, type Item0.item = Item0.item @@ -1018,12 +1018,6 @@ module C08CollectExtend_Collect type i = i clone CreusotContracts_Std1_Iter_Iterator_Completed_Interface as Completed0 with type self = i - clone Alloc_Vec_Impl1_Push_Interface as Push0 with - type t = Item0.item, - type a = Alloc_Alloc_Global_Type.t_global, - function ShallowModel0.shallow_model = ShallowModel0.shallow_model, - function ShallowModel1.shallow_model = ShallowModel1.shallow_model, - val Max0.mAX' = Max0.mAX' clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve5 with type t = Item0.item, function ShallowModel0.shallow_model = ShallowModel0.shallow_model, @@ -1032,6 +1026,12 @@ module C08CollectExtend_Collect val Max0.mAX' = Max0.mAX' clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with type self = i + clone Alloc_Vec_Impl1_Push_Interface as Push0 with + type t = Item0.item, + type a = Alloc_Alloc_Global_Type.t_global, + function ShallowModel0.shallow_model = ShallowModel0.shallow_model, + function ShallowModel1.shallow_model = ShallowModel1.shallow_model, + val Max0.mAX' = Max0.mAX' use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with type self = Core_Option_Option_Type.t_option Item0.item @@ -1197,7 +1197,7 @@ module C08CollectExtend_Collect } end -module Alloc_Vec_Impl9_Deref_Interface +module Alloc_Vec_Impl8_Deref_Interface type t type a use prelude.Borrow @@ -1330,7 +1330,7 @@ module CreusotContracts_Std1_Vec_Impl3_IntoIterPost ensures { result = into_iter_post self res } end -module Alloc_Vec_Impl16_IntoIter_Interface +module Alloc_Vec_Impl15_IntoIter_Interface type t type a use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type @@ -1727,13 +1727,13 @@ module C08CollectExtend_ExtendIndex function ShallowModel0.shallow_model = ShallowModel0.shallow_model, function ShallowModel1.shallow_model = ShallowModel4.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl16_IntoIter_Interface as IntoIter0 with + clone Alloc_Vec_Impl15_IntoIter_Interface as IntoIter0 with type t = uint32, type a = Alloc_Alloc_Global_Type.t_global, predicate IntoIterPre0.into_iter_pre = IntoIterPre0.into_iter_pre, predicate IntoIterPost0.into_iter_post = IntoIterPost0.into_iter_post, predicate Inv0.inv = Inv0.inv - clone Alloc_Vec_Impl9_Deref_Interface as Deref0 with + clone Alloc_Vec_Impl8_Deref_Interface as Deref0 with type t = uint32, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel2.shallow_model, diff --git a/creusot/tests/should_succeed/iterators/08_collect_extend/why3session.xml b/creusot/tests/should_succeed/iterators/08_collect_extend/why3session.xml index d27b070a94..c7c26a85cc 100644 --- a/creusot/tests/should_succeed/iterators/08_collect_extend/why3session.xml +++ b/creusot/tests/should_succeed/iterators/08_collect_extend/why3session.xml @@ -30,7 +30,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/creusot/tests/should_succeed/iterators/08_collect_extend/why3shapes.gz b/creusot/tests/should_succeed/iterators/08_collect_extend/why3shapes.gz index 13e7494274..6fd4618200 100644 Binary files a/creusot/tests/should_succeed/iterators/08_collect_extend/why3shapes.gz and b/creusot/tests/should_succeed/iterators/08_collect_extend/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/09_empty.mlcfg b/creusot/tests/should_succeed/iterators/09_empty.mlcfg index dc25cf6b93..ee81f49188 100644 --- a/creusot/tests/should_succeed/iterators/09_empty.mlcfg +++ b/creusot/tests/should_succeed/iterators/09_empty.mlcfg @@ -266,6 +266,13 @@ module CreusotContracts_Invariant_Inv ensures { result = inv _x } end +module C09Empty_Empty_Type_Inv + type t + use C09Empty_Empty_Type as C09Empty_Empty_Type + clone CreusotContracts_Invariant_Inv_Stub as Inv0 with + type t = C09Empty_Empty_Type.t_empty t + axiom inv_t_empty : forall self : C09Empty_Empty_Type.t_empty t . Inv0.inv self = true +end module TyInv_Borrow type t use prelude.Borrow @@ -275,54 +282,47 @@ module TyInv_Borrow type t = borrowed t axiom inv_borrow [@rewrite] : forall self : borrowed t . Inv0.inv self = Inv1.inv ( * self) end -module C09Empty_Empty_Type_Inv - type t - use C09Empty_Empty_Type as C09Empty_Empty_Type - clone CreusotContracts_Invariant_Inv_Stub as Inv0 with - type t = C09Empty_Empty_Type.t_empty t - axiom inv_t_empty : forall self : C09Empty_Empty_Type.t_empty t . Inv0.inv self = true -end module C09Empty_Common_Iterator_Item_Type type self type item end module C09Empty_Impl0 type t - use prelude.Borrow use seq.Seq + use prelude.Borrow use C09Empty_Empty_Type as C09Empty_Empty_Type - clone CreusotContracts_Invariant_Inv_Interface as Inv1 with - type t = C09Empty_Empty_Type.t_empty t - clone C09Empty_Empty_Type_Inv as C09Empty_Empty_Type_Inv0 with - type t = t, - predicate Inv0.inv = Inv1.inv, - axiom . clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = C09Empty_Empty_Type.t_empty t clone CreusotContracts_Invariant_Inv_Interface as Inv0 with + type t = C09Empty_Empty_Type.t_empty t + clone CreusotContracts_Invariant_Inv_Interface as Inv1 with type t = borrowed (C09Empty_Empty_Type.t_empty t) clone TyInv_Borrow as TyInv_Borrow0 with type t = C09Empty_Empty_Type.t_empty t, + predicate Inv0.inv = Inv1.inv, + predicate Inv1.inv = Inv0.inv, + axiom . + clone C09Empty_Empty_Type_Inv as C09Empty_Empty_Type_Inv0 with + type t = t, predicate Inv0.inv = Inv0.inv, - predicate Inv1.inv = Inv1.inv, axiom . clone C09Empty_Common_Iterator_Item_Type as Item0 with type self = C09Empty_Empty_Type.t_empty t use Core_Option_Option_Type as Core_Option_Option_Type - clone C09Empty_Impl0_Produces as Produces0 with - type t = t clone C09Empty_Impl0_Completed as Completed0 with type t = t, predicate Resolve0.resolve = Resolve0.resolve - goal next_refn : [#"../09_empty.rs" 41 4 41 35] forall self : borrowed (C09Empty_Empty_Type.t_empty t) . Inv0.inv self -> (forall result : Core_Option_Option_Type.t_option t . match (result) with + clone C09Empty_Impl0_Produces as Produces0 with + type t = t + goal produces_trans_refn : [#"../09_empty.rs" 35 4 35 90] forall a : C09Empty_Empty_Type.t_empty t . forall ab : Seq.seq t . forall b : C09Empty_Empty_Type.t_empty t . forall bc : Seq.seq t . forall c : C09Empty_Empty_Type.t_empty t . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal produces_refl_refn : [#"../09_empty.rs" 28 4 28 29] forall a : C09Empty_Empty_Type.t_empty t . Inv0.inv a -> (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal next_refn : [#"../09_empty.rs" 41 4 41 35] forall self : borrowed (C09Empty_Empty_Type.t_empty t) . Inv1.inv self -> (forall result : Core_Option_Option_Type.t_option t . match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) - end -> Inv1.inv ( ^ self) /\ match (result) with + end -> Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_refl_refn : [#"../09_empty.rs" 28 4 28 29] forall a : C09Empty_Empty_Type.t_empty t . Inv1.inv a -> (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) - goal produces_trans_refn : [#"../09_empty.rs" 35 4 35 90] forall a : C09Empty_Empty_Type.t_empty t . forall ab : Seq.seq t . forall b : C09Empty_Empty_Type.t_empty t . forall bc : Seq.seq t . forall c : C09Empty_Empty_Type.t_empty t . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) end module C09Empty_Impl1 type t diff --git a/creusot/tests/should_succeed/iterators/09_empty/why3session.xml b/creusot/tests/should_succeed/iterators/09_empty/why3session.xml index 916eb4e7a4..8f0d0c6477 100644 --- a/creusot/tests/should_succeed/iterators/09_empty/why3session.xml +++ b/creusot/tests/should_succeed/iterators/09_empty/why3session.xml @@ -21,14 +21,14 @@ - - + + - - + + diff --git a/creusot/tests/should_succeed/iterators/09_empty/why3shapes.gz b/creusot/tests/should_succeed/iterators/09_empty/why3shapes.gz index 080a81fcf4..91e00b66a3 100644 Binary files a/creusot/tests/should_succeed/iterators/09_empty/why3shapes.gz and b/creusot/tests/should_succeed/iterators/09_empty/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/10_once.mlcfg b/creusot/tests/should_succeed/iterators/10_once.mlcfg index 6d65ea6359..fa050e6a8e 100644 --- a/creusot/tests/should_succeed/iterators/10_once.mlcfg +++ b/creusot/tests/should_succeed/iterators/10_once.mlcfg @@ -365,7 +365,6 @@ module C10Once_Impl0 clone C10Once_Impl0_Produces as Produces0 with type t = t goal produces_refl_refn : [#"../10_once.rs" 31 4 31 29] forall a : C10Once_Once_Type.t_once t . Inv0.inv a -> (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) - goal produces_trans_refn : [#"../10_once.rs" 38 4 38 90] forall a : C10Once_Once_Type.t_once t . forall ab : Seq.seq t . forall b : C10Once_Once_Type.t_once t . forall bc : Seq.seq t . forall c : C10Once_Once_Type.t_once t . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) goal next_refn : [#"../10_once.rs" 44 4 44 35] forall self : borrowed (C10Once_Once_Type.t_once t) . Inv1.inv self -> (forall result : Core_Option_Option_Type.t_option t . match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) @@ -373,6 +372,7 @@ module C10Once_Impl0 | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) + goal produces_trans_refn : [#"../10_once.rs" 38 4 38 90] forall a : C10Once_Once_Type.t_once t . forall ab : Seq.seq t . forall b : C10Once_Once_Type.t_once t . forall bc : Seq.seq t . forall c : C10Once_Once_Type.t_once t . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) end module C10Once_Impl1 type t diff --git a/creusot/tests/should_succeed/iterators/12_zip.mlcfg b/creusot/tests/should_succeed/iterators/12_zip.mlcfg index 8f249208f8..053634fb36 100644 --- a/creusot/tests/should_succeed/iterators/12_zip.mlcfg +++ b/creusot/tests/should_succeed/iterators/12_zip.mlcfg @@ -922,12 +922,26 @@ end module C12Zip_Impl0 type i type j - use prelude.Borrow use seq.Seq + use prelude.Borrow clone CreusotContracts_Invariant_Inv_Interface as Inv3 with type t = j clone CreusotContracts_Invariant_Inv_Interface as Inv2 with type t = i + clone C12Zip_Common_Iterator_Completed_Interface as Completed2 with + type self = j + clone C12Zip_Common_Iterator_Completed_Interface as Completed1 with + type self = i + use C12Zip_Zip_Type as C12Zip_Zip_Type + clone CreusotContracts_Invariant_Inv_Interface as Inv0 with + type t = C12Zip_Zip_Type.t_zip i j + clone CreusotContracts_Invariant_Inv_Interface as Inv1 with + type t = borrowed (C12Zip_Zip_Type.t_zip i j) + clone TyInv_Borrow as TyInv_Borrow0 with + type t = C12Zip_Zip_Type.t_zip i j, + predicate Inv0.inv = Inv1.inv, + predicate Inv1.inv = Inv0.inv, + axiom . clone C12Zip_Common_Iterator_Item_Type as Item1 with type self = j clone C12Zip_Common_Iterator_Produces_Interface as Produces2 with @@ -938,30 +952,21 @@ module C12Zip_Impl0 clone C12Zip_Common_Iterator_Produces_Interface as Produces1 with type self = i, type Item0.item = Item0.item - clone C12Zip_Common_Iterator_Completed_Interface as Completed2 with - type self = j - clone C12Zip_Common_Iterator_Completed_Interface as Completed1 with - type self = i - use C12Zip_Zip_Type as C12Zip_Zip_Type - clone CreusotContracts_Invariant_Inv_Interface as Inv1 with - type t = C12Zip_Zip_Type.t_zip i j clone C12Zip_Zip_Type_Inv as C12Zip_Zip_Type_Inv0 with type i = i, type j = j, - predicate Inv0.inv = Inv1.inv, + predicate Inv0.inv = Inv0.inv, predicate Inv1.inv = Inv2.inv, predicate Inv2.inv = Inv3.inv, axiom . - clone CreusotContracts_Invariant_Inv_Interface as Inv0 with - type t = borrowed (C12Zip_Zip_Type.t_zip i j) - clone TyInv_Borrow as TyInv_Borrow0 with - type t = C12Zip_Zip_Type.t_zip i j, - predicate Inv0.inv = Inv0.inv, - predicate Inv1.inv = Inv1.inv, - axiom . clone C12Zip_Common_Iterator_Item_Type as Item2 with type self = C12Zip_Zip_Type.t_zip i j use Core_Option_Option_Type as Core_Option_Option_Type + clone C12Zip_Impl0_Completed as Completed0 with + type i = i, + type j = j, + predicate Completed0.completed = Completed1.completed, + predicate Completed1.completed = Completed2.completed clone C12Zip_Impl0_Produces as Produces0 with type i = i, type j = j, @@ -969,20 +974,15 @@ module C12Zip_Impl0 type Item1.item = Item1.item, predicate Produces0.produces = Produces1.produces, predicate Produces1.produces = Produces2.produces - clone C12Zip_Impl0_Completed as Completed0 with - type i = i, - type j = j, - predicate Completed0.completed = Completed1.completed, - predicate Completed1.completed = Completed2.completed - goal next_refn : [#"../12_zip.rs" 50 4 50 44] forall self : borrowed (C12Zip_Zip_Type.t_zip i j) . Inv0.inv self -> Inv0.inv self /\ (forall result : Core_Option_Option_Type.t_option (Item0.item, Item1.item) . Inv1.inv ( ^ self) /\ match (result) with + goal produces_refl_refn : [#"../12_zip.rs" 37 4 37 29] forall a : C12Zip_Zip_Type.t_zip i j . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal produces_trans_refn : [#"../12_zip.rs" 44 4 44 90] forall a : C12Zip_Zip_Type.t_zip i j . forall ab : Seq.seq (Item0.item, Item1.item) . forall b : C12Zip_Zip_Type.t_zip i j . forall bc : Seq.seq (Item0.item, Item1.item) . forall c : C12Zip_Zip_Type.t_zip i j . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal next_refn : [#"../12_zip.rs" 50 4 50 44] forall self : borrowed (C12Zip_Zip_Type.t_zip i j) . Inv1.inv self -> Inv1.inv self /\ (forall result : Core_Option_Option_Type.t_option (Item0.item, Item1.item) . Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) - end -> Inv1.inv ( ^ self) /\ match (result) with + end -> Inv0.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_trans_refn : [#"../12_zip.rs" 44 4 44 90] forall a : C12Zip_Zip_Type.t_zip i j . forall ab : Seq.seq (Item0.item, Item1.item) . forall b : C12Zip_Zip_Type.t_zip i j . forall bc : Seq.seq (Item0.item, Item1.item) . forall c : C12Zip_Zip_Type.t_zip i j . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) - goal produces_refl_refn : [#"../12_zip.rs" 37 4 37 29] forall a : C12Zip_Zip_Type.t_zip i j . Inv1.inv a -> Inv1.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) end module C12Zip_Impl1 type i diff --git a/creusot/tests/should_succeed/iterators/12_zip/why3session.xml b/creusot/tests/should_succeed/iterators/12_zip/why3session.xml index a896319d1c..53ac42c889 100644 --- a/creusot/tests/should_succeed/iterators/12_zip/why3session.xml +++ b/creusot/tests/should_succeed/iterators/12_zip/why3session.xml @@ -70,14 +70,14 @@ - - + + - - + + diff --git a/creusot/tests/should_succeed/iterators/12_zip/why3shapes.gz b/creusot/tests/should_succeed/iterators/12_zip/why3shapes.gz index ea971dcce4..0c62e1a9a3 100644 Binary files a/creusot/tests/should_succeed/iterators/12_zip/why3shapes.gz and b/creusot/tests/should_succeed/iterators/12_zip/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/14_copied.mlcfg b/creusot/tests/should_succeed/iterators/14_copied.mlcfg index 9614a74ed2..ec88b4f0c6 100644 --- a/creusot/tests/should_succeed/iterators/14_copied.mlcfg +++ b/creusot/tests/should_succeed/iterators/14_copied.mlcfg @@ -655,50 +655,50 @@ end module C14Copied_Impl0 type i type t - use seq.Seq use prelude.Borrow + use seq.Seq clone CreusotContracts_Invariant_Inv_Interface as Inv2 with type t = i + clone C14Copied_Common_Iterator_Produces_Interface as Produces1 with + type self = i, + type Item0.item = t clone C14Copied_Common_Iterator_Completed_Interface as Completed1 with type self = i use C14Copied_Copied_Type as C14Copied_Copied_Type - clone CreusotContracts_Invariant_Inv_Interface as Inv0 with - type t = C14Copied_Copied_Type.t_copied i clone CreusotContracts_Invariant_Inv_Interface as Inv1 with + type t = C14Copied_Copied_Type.t_copied i + clone C14Copied_Copied_Type_Inv as C14Copied_Copied_Type_Inv0 with + type i = i, + predicate Inv0.inv = Inv1.inv, + predicate Inv1.inv = Inv2.inv, + axiom . + clone CreusotContracts_Invariant_Inv_Interface as Inv0 with type t = borrowed (C14Copied_Copied_Type.t_copied i) clone TyInv_Borrow as TyInv_Borrow0 with type t = C14Copied_Copied_Type.t_copied i, - predicate Inv0.inv = Inv1.inv, - predicate Inv1.inv = Inv0.inv, - axiom . - clone C14Copied_Common_Iterator_Produces_Interface as Produces1 with - type self = i, - type Item0.item = t - clone C14Copied_Copied_Type_Inv as C14Copied_Copied_Type_Inv0 with - type i = i, predicate Inv0.inv = Inv0.inv, - predicate Inv1.inv = Inv2.inv, + predicate Inv1.inv = Inv1.inv, axiom . clone C14Copied_Common_Iterator_Item_Type as Item0 with type self = C14Copied_Copied_Type.t_copied i use Core_Option_Option_Type as Core_Option_Option_Type - clone C14Copied_Impl0_Completed as Completed0 with - type i = i, - type t = t, - predicate Completed0.completed = Completed1.completed clone C14Copied_Impl0_Produces as Produces0 with type i = i, type t = t, predicate Produces0.produces = Produces1.produces - goal produces_refl_refn : [#"../14_copied.rs" 39 4 39 29] forall a : C14Copied_Copied_Type.t_copied i . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) - goal next_refn : [#"../14_copied.rs" 52 4 52 35] forall self : borrowed (C14Copied_Copied_Type.t_copied i) . Inv1.inv self -> Inv1.inv self /\ (forall result : Core_Option_Option_Type.t_option t . Inv0.inv ( ^ self) /\ match (result) with + clone C14Copied_Impl0_Completed as Completed0 with + type i = i, + type t = t, + predicate Completed0.completed = Completed1.completed + goal next_refn : [#"../14_copied.rs" 52 4 52 35] forall self : borrowed (C14Copied_Copied_Type.t_copied i) . Inv0.inv self -> Inv0.inv self /\ (forall result : Core_Option_Option_Type.t_option t . Inv1.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) - end -> Inv0.inv ( ^ self) /\ match (result) with + end -> Inv1.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) - goal produces_trans_refn : [#"../14_copied.rs" 46 4 46 90] forall a : C14Copied_Copied_Type.t_copied i . forall ab : Seq.seq t . forall b : C14Copied_Copied_Type.t_copied i . forall bc : Seq.seq t . forall c : C14Copied_Copied_Type.t_copied i . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal produces_trans_refn : [#"../14_copied.rs" 46 4 46 90] forall a : C14Copied_Copied_Type.t_copied i . forall ab : Seq.seq t . forall b : C14Copied_Copied_Type.t_copied i . forall bc : Seq.seq t . forall c : C14Copied_Copied_Type.t_copied i . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) + goal produces_refl_refn : [#"../14_copied.rs" 39 4 39 29] forall a : C14Copied_Copied_Type.t_copied i . Inv1.inv a -> Inv1.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) end module C14Copied_Impl1 type i diff --git a/creusot/tests/should_succeed/iterators/14_copied/why3session.xml b/creusot/tests/should_succeed/iterators/14_copied/why3session.xml index 9d0bcf2cec..56728066ad 100644 --- a/creusot/tests/should_succeed/iterators/14_copied/why3session.xml +++ b/creusot/tests/should_succeed/iterators/14_copied/why3session.xml @@ -21,15 +21,15 @@ - - - + + + diff --git a/creusot/tests/should_succeed/iterators/14_copied/why3shapes.gz b/creusot/tests/should_succeed/iterators/14_copied/why3shapes.gz index 4a5ffdce13..f989237813 100644 Binary files a/creusot/tests/should_succeed/iterators/14_copied/why3shapes.gz and b/creusot/tests/should_succeed/iterators/14_copied/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/iterators/15_enumerate.mlcfg b/creusot/tests/should_succeed/iterators/15_enumerate.mlcfg index 7556853cdc..a6a682ebf4 100644 --- a/creusot/tests/should_succeed/iterators/15_enumerate.mlcfg +++ b/creusot/tests/should_succeed/iterators/15_enumerate.mlcfg @@ -947,10 +947,10 @@ module C15Enumerate_Enumerate end module C15Enumerate_Impl0 type i - use seq.Seq + use prelude.Borrow use prelude.Int use prelude.UIntSize - use prelude.Borrow + use seq.Seq clone CreusotContracts_Invariant_Inv_Interface as Inv2 with type t = i clone CreusotContracts_Invariant_Inv_Interface as Inv3 with @@ -977,40 +977,40 @@ module C15Enumerate_Impl0 val Max0.mAX' = Max0.mAX', predicate Inv1.inv = Inv3.inv, predicate Completed0.completed = Completed1.completed - clone CreusotContracts_Invariant_Inv_Interface as Inv0 with - type t = C15Enumerate_Enumerate_Type.t_enumerate i clone CreusotContracts_Invariant_Inv_Interface as Inv1 with - type t = borrowed (C15Enumerate_Enumerate_Type.t_enumerate i) - clone TyInv_Borrow as TyInv_Borrow0 with - type t = C15Enumerate_Enumerate_Type.t_enumerate i, - predicate Inv0.inv = Inv1.inv, - predicate Inv1.inv = Inv0.inv, - axiom . + type t = C15Enumerate_Enumerate_Type.t_enumerate i clone C15Enumerate_Enumerate_Type_Inv as C15Enumerate_Enumerate_Type_Inv0 with type i = i, - predicate Inv0.inv = Inv0.inv, + predicate Inv0.inv = Inv1.inv, predicate Invariant0.invariant' = Invariant0.invariant', predicate Inv1.inv = Inv2.inv, axiom . + clone CreusotContracts_Invariant_Inv_Interface as Inv0 with + type t = borrowed (C15Enumerate_Enumerate_Type.t_enumerate i) + clone TyInv_Borrow as TyInv_Borrow0 with + type t = C15Enumerate_Enumerate_Type.t_enumerate i, + predicate Inv0.inv = Inv0.inv, + predicate Inv1.inv = Inv1.inv, + axiom . clone C15Enumerate_Common_Iterator_Item_Type as Item1 with type self = C15Enumerate_Enumerate_Type.t_enumerate i use Core_Option_Option_Type as Core_Option_Option_Type - clone C15Enumerate_Impl0_Completed as Completed0 with - type i = i, - predicate Completed0.completed = Completed1.completed clone C15Enumerate_Impl0_Produces as Produces0 with type i = i, type Item0.item = Item0.item, predicate Produces0.produces = Produces1.produces - goal produces_trans_refn : [#"../15_enumerate.rs" 47 4 47 90] forall a : C15Enumerate_Enumerate_Type.t_enumerate i . forall ab : Seq.seq (usize, Item0.item) . forall b : C15Enumerate_Enumerate_Type.t_enumerate i . forall bc : Seq.seq (usize, Item0.item) . forall c : C15Enumerate_Enumerate_Type.t_enumerate i . Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv0.inv c /\ Inv0.inv b /\ Inv0.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) - goal produces_refl_refn : [#"../15_enumerate.rs" 40 4 40 29] forall a : C15Enumerate_Enumerate_Type.t_enumerate i . Inv0.inv a -> Inv0.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) - goal next_refn : [#"../15_enumerate.rs" 53 4 53 44] forall self : borrowed (C15Enumerate_Enumerate_Type.t_enumerate i) . Inv1.inv self -> Inv1.inv self /\ (forall result : Core_Option_Option_Type.t_option (usize, Item0.item) . Inv0.inv ( ^ self) /\ match (result) with + clone C15Enumerate_Impl0_Completed as Completed0 with + type i = i, + predicate Completed0.completed = Completed1.completed + goal next_refn : [#"../15_enumerate.rs" 53 4 53 44] forall self : borrowed (C15Enumerate_Enumerate_Type.t_enumerate i) . Inv0.inv self -> Inv0.inv self /\ (forall result : Core_Option_Option_Type.t_option (usize, Item0.item) . Inv1.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) - end -> Inv0.inv ( ^ self) /\ match (result) with + end -> Inv1.inv ( ^ self) /\ match (result) with | Core_Option_Option_Type.C_None -> Completed0.completed self | Core_Option_Option_Type.C_Some v -> Produces0.produces ( * self) (Seq.singleton v) ( ^ self) end) + goal produces_refl_refn : [#"../15_enumerate.rs" 40 4 40 29] forall a : C15Enumerate_Enumerate_Type.t_enumerate i . Inv1.inv a -> Inv1.inv a /\ (forall result : () . Produces0.produces a (Seq.empty ) a -> Produces0.produces a (Seq.empty ) a) + goal produces_trans_refn : [#"../15_enumerate.rs" 47 4 47 90] forall a : C15Enumerate_Enumerate_Type.t_enumerate i . forall ab : Seq.seq (usize, Item0.item) . forall b : C15Enumerate_Enumerate_Type.t_enumerate i . forall bc : Seq.seq (usize, Item0.item) . forall c : C15Enumerate_Enumerate_Type.t_enumerate i . Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b -> Inv1.inv c /\ Inv1.inv b /\ Inv1.inv a /\ Produces0.produces b bc c /\ Produces0.produces a ab b /\ (forall result : () . Produces0.produces a (Seq.(++) ab bc) c -> Produces0.produces a (Seq.(++) ab bc) c) end module C15Enumerate_Impl1 type i diff --git a/creusot/tests/should_succeed/iterators/15_enumerate/why3session.xml b/creusot/tests/should_succeed/iterators/15_enumerate/why3session.xml index c34b6e7b5c..9af7a98d78 100644 --- a/creusot/tests/should_succeed/iterators/15_enumerate/why3session.xml +++ b/creusot/tests/should_succeed/iterators/15_enumerate/why3session.xml @@ -26,13 +26,13 @@ - + - + diff --git a/creusot/tests/should_succeed/iterators/15_enumerate/why3shapes.gz b/creusot/tests/should_succeed/iterators/15_enumerate/why3shapes.gz index f99e4b485c..532d93c862 100644 Binary files a/creusot/tests/should_succeed/iterators/15_enumerate/why3shapes.gz and b/creusot/tests/should_succeed/iterators/15_enumerate/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/knapsack.mlcfg b/creusot/tests/should_succeed/knapsack.mlcfg index 12b3eea271..6486076fbf 100644 --- a/creusot/tests/should_succeed/knapsack.mlcfg +++ b/creusot/tests/should_succeed/knapsack.mlcfg @@ -323,28 +323,6 @@ module CreusotContracts_Resolve_Resolve_Resolve val resolve (self : self) : bool ensures { result = resolve self } -end -module CreusotContracts_Resolve_Impl1_Resolve_Stub - type t - use prelude.Borrow - predicate resolve (self : borrowed t) -end -module CreusotContracts_Resolve_Impl1_Resolve_Interface - type t - use prelude.Borrow - predicate resolve (self : borrowed t) - val resolve (self : borrowed t) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Resolve_Impl1_Resolve - type t - use prelude.Borrow - predicate resolve (self : borrowed t) = - [#"../../../../creusot-contracts/src/resolve.rs" 25 20 25 34] ^ self = * self - val resolve (self : borrowed t) : bool - ensures { result = resolve self } - end module CreusotContracts_Std1_Vec_Impl10_Resolve_Stub type t @@ -383,6 +361,28 @@ module CreusotContracts_Std1_Vec_Impl10_Resolve val resolve (self : Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global)) : bool ensures { result = resolve self } +end +module CreusotContracts_Resolve_Impl1_Resolve_Stub + type t + use prelude.Borrow + predicate resolve (self : borrowed t) +end +module CreusotContracts_Resolve_Impl1_Resolve_Interface + type t + use prelude.Borrow + predicate resolve (self : borrowed t) + val resolve (self : borrowed t) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Resolve_Impl1_Resolve + type t + use prelude.Borrow + predicate resolve (self : borrowed t) = + [#"../../../../creusot-contracts/src/resolve.rs" 25 20 25 34] ^ self = * self + val resolve (self : borrowed t) : bool + ensures { result = resolve self } + end module Alloc_Vec_FromElem_Interface type t @@ -420,6 +420,23 @@ module Alloc_Vec_Impl1_Len_Interface val len (self : Alloc_Vec_Vec_Type.t_vec t a) : usize ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 66 26 66 48] UIntSize.to_int result = Seq.length (ShallowModel0.shallow_model self) } +end +module Alloc_Vec_Impl0_WithCapacity_Interface + type t + use seq.Seq + use prelude.Int + use prelude.UIntSize + clone Core_Num_Impl11_Max_Stub as Max0 + use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type + use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type + clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Stub as ShallowModel0 with + type t = t, + type a = Alloc_Alloc_Global_Type.t_global, + val Max0.mAX' = Max0.mAX', + axiom . + val with_capacity (capacity : usize) : Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 62 26 62 44] Seq.length (ShallowModel0.shallow_model result) = 0 } + end module CreusotContracts_Std1_Slice_SliceIndex_InBounds_Stub type self @@ -489,7 +506,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -548,6 +565,26 @@ module CreusotContracts_Model_Impl7_ShallowModel val shallow_model (self : borrowed t) : ShallowModelTy0.shallowModelTy ensures { result = shallow_model self } +end +module Alloc_Vec_Impl1_Push_Interface + type t + type a + use prelude.Borrow + use seq.Seq + use seq.Seq + clone Core_Num_Impl11_Max_Stub as Max0 + use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type + clone CreusotContracts_Model_Impl7_ShallowModel_Stub as ShallowModel1 with + type t = Alloc_Vec_Vec_Type.t_vec t a, + type ShallowModelTy0.shallowModelTy = Seq.seq t + clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Stub as ShallowModel0 with + type t = t, + type a = a, + val Max0.mAX' = Max0.mAX', + axiom . + val push (self : borrowed (Alloc_Vec_Vec_Type.t_vec t a)) (value : t) : () + ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 69 26 69 51] ShallowModel0.shallow_model ( ^ self) = Seq.snoc (ShallowModel1.shallow_model self) value } + end module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere_Stub type self @@ -579,7 +616,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -620,43 +657,6 @@ module Alloc_Vec_Impl14_IndexMut_Interface ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 125 26 125 62] ResolveElswhere0.resolve_elswhere index (ShallowModel0.shallow_model self) (ShallowModel1.shallow_model ( ^ self)) } ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 126 26 126 55] Seq.length (ShallowModel1.shallow_model ( ^ self)) = Seq.length (ShallowModel0.shallow_model self) } -end -module Alloc_Vec_Impl0_WithCapacity_Interface - type t - use seq.Seq - use prelude.Int - use prelude.UIntSize - clone Core_Num_Impl11_Max_Stub as Max0 - use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type - use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type - clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Stub as ShallowModel0 with - type t = t, - type a = Alloc_Alloc_Global_Type.t_global, - val Max0.mAX' = Max0.mAX', - axiom . - val with_capacity (capacity : usize) : Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 62 26 62 44] Seq.length (ShallowModel0.shallow_model result) = 0 } - -end -module Alloc_Vec_Impl1_Push_Interface - type t - type a - use prelude.Borrow - use seq.Seq - use seq.Seq - clone Core_Num_Impl11_Max_Stub as Max0 - use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type - clone CreusotContracts_Model_Impl7_ShallowModel_Stub as ShallowModel1 with - type t = Alloc_Vec_Vec_Type.t_vec t a, - type ShallowModelTy0.shallowModelTy = Seq.seq t - clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Stub as ShallowModel0 with - type t = t, - type a = a, - val Max0.mAX' = Max0.mAX', - axiom . - val push (self : borrowed (Alloc_Vec_Vec_Type.t_vec t a)) (value : t) : () - ensures { [#"../../../../creusot-contracts/src/std/vec.rs" 69 26 69 51] ShallowModel0.shallow_model ( ^ self) = Seq.snoc (ShallowModel1.shallow_model self) value } - end module CreusotContracts_Std1_Slice_Impl5_InBounds_Stub type t @@ -791,38 +791,18 @@ module Knapsack_Knapsack01Dyn use prelude.Borrow clone CreusotContracts_Resolve_Impl2_Resolve as Resolve6 with type t = usize - clone Core_Num_Impl11_Max as Max1 - use seq.Seq + clone CreusotContracts_Std1_Slice_Impl5_ResolveElswhere as ResolveElswhere1 with + type t = usize use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type use Alloc_Vec_Vec_Type as Alloc_Vec_Vec_Type + clone Core_Num_Impl11_Max as Max1 clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel2 with type t = usize, type a = Alloc_Alloc_Global_Type.t_global, val Max0.mAX' = Max1.mAX', axiom . - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic2 with - type t = usize, - type s = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve5 with - type t = usize, - function ShallowModel0.shallow_model = ShallowModel2.shallow_model, - function IndexLogic0.index_logic = IndexLogic2.index_logic, - predicate Resolve0.resolve = Resolve6.resolve, - val Max0.mAX' = Max1.mAX' - use Knapsack_Item_Type as Knapsack_Item_Type - clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel8 with - type t = Knapsack_Item_Type.t_item name, - type a = Alloc_Alloc_Global_Type.t_global, - val Max0.mAX' = Max1.mAX', - axiom . + use seq.Seq clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel9 with - type t = Alloc_Vec_Vec_Type.t_vec (Knapsack_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global), - type ShallowModelTy0.shallowModelTy = Seq.seq (Knapsack_Item_Type.t_item name), - function ShallowModel0.shallow_model = ShallowModel8.shallow_model - clone CreusotContracts_Std1_Slice_Impl5_ResolveElswhere as ResolveElswhere1 with - type t = usize - clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel7 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq usize, function ShallowModel0.shallow_model = ShallowModel2.shallow_model @@ -833,15 +813,25 @@ module Knapsack_Knapsack01Dyn type a = Alloc_Alloc_Global_Type.t_global, val Max0.mAX' = Max1.mAX', axiom . - clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel6 with + clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel8 with type t = Alloc_Vec_Vec_Type.t_vec (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)) (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)), function ShallowModel0.shallow_model = ShallowModel1.shallow_model + use Knapsack_Item_Type as Knapsack_Item_Type + clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel4 with + type t = Knapsack_Item_Type.t_item name, + type a = Alloc_Alloc_Global_Type.t_global, + val Max0.mAX' = Max1.mAX', + axiom . + clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel7 with + type t = Alloc_Vec_Vec_Type.t_vec (Knapsack_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global), + type ShallowModelTy0.shallowModelTy = Seq.seq (Knapsack_Item_Type.t_item name), + function ShallowModel0.shallow_model = ShallowModel4.shallow_model clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue2 with type t = usize clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds2 with type t = usize - clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel5 with + clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel6 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq usize, function ShallowModel0.shallow_model = ShallowModel2.shallow_model @@ -849,7 +839,7 @@ module Knapsack_Knapsack01Dyn type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global) clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds1 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel4 with + clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel5 with type t = Alloc_Vec_Vec_Type.t_vec (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)) (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)), function ShallowModel0.shallow_model = ShallowModel1.shallow_model @@ -857,6 +847,16 @@ module Knapsack_Knapsack01Dyn type t = Knapsack_Item_Type.t_item name clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds0 with type t = Knapsack_Item_Type.t_item name + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic2 with + type t = usize, + type s = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel2.shallow_model + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve5 with + type t = usize, + function ShallowModel0.shallow_model = ShallowModel2.shallow_model, + function IndexLogic0.index_logic = IndexLogic2.index_logic, + predicate Resolve0.resolve = Resolve6.resolve, + val Max0.mAX' = Max1.mAX' clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel3 with type t = Knapsack_Item_Type.t_item name, type a = Alloc_Alloc_Global_Type.t_global, @@ -870,74 +870,58 @@ module Knapsack_Knapsack01Dyn type t = Knapsack_Item_Type.t_item name, type s = Alloc_Vec_Vec_Type.t_vec (Knapsack_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with - type self = Alloc_Vec_Vec_Type.t_vec (Knapsack_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with - type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - type s = Alloc_Vec_Vec_Type.t_vec (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)) (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve3 with - type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel1.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve5.resolve, - val Max0.mAX' = Max1.mAX' - clone Alloc_Vec_Impl1_Push_Interface as Push0 with - type t = Knapsack_Item_Type.t_item name, - type a = Alloc_Alloc_Global_Type.t_global, - function ShallowModel0.shallow_model = ShallowModel8.shallow_model, - function ShallowModel1.shallow_model = ShallowModel9.shallow_model, - val Max0.mAX' = Max1.mAX' - clone Alloc_Vec_Impl0_WithCapacity_Interface as WithCapacity0 with - type t = Knapsack_Item_Type.t_item name, - function ShallowModel0.shallow_model = ShallowModel8.shallow_model, - val Max0.mAX' = Max1.mAX' - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = usize - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut1 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut1 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, - function ShallowModel0.shallow_model = ShallowModel7.shallow_model, + function ShallowModel0.shallow_model = ShallowModel9.shallow_model, predicate InBounds0.in_bounds = InBounds2.in_bounds, predicate HasValue0.has_value = HasValue2.has_value, function ShallowModel1.shallow_model = ShallowModel2.shallow_model, predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere1.resolve_elswhere, type Output0.output = usize, val Max0.mAX' = Max1.mAX' - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, type Output0.output = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel6.shallow_model, + function ShallowModel0.shallow_model = ShallowModel8.shallow_model, predicate InBounds0.in_bounds = InBounds1.in_bounds, predicate HasValue0.has_value = HasValue1.has_value, function ShallowModel1.shallow_model = ShallowModel1.shallow_model, predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere0.resolve_elswhere, val Max0.mAX' = Max1.mAX' clone Knapsack_Max_Interface as Max0 - clone Alloc_Vec_Impl13_Index_Interface as Index2 with + clone Alloc_Vec_Impl1_Push_Interface as Push0 with + type t = Knapsack_Item_Type.t_item name, + type a = Alloc_Alloc_Global_Type.t_global, + function ShallowModel0.shallow_model = ShallowModel4.shallow_model, + function ShallowModel1.shallow_model = ShallowModel7.shallow_model, + val Max0.mAX' = Max1.mAX' + clone Alloc_Vec_Impl12_Index_Interface as Index2 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, - function ShallowModel0.shallow_model = ShallowModel5.shallow_model, + function ShallowModel0.shallow_model = ShallowModel6.shallow_model, predicate InBounds0.in_bounds = InBounds2.in_bounds, predicate HasValue0.has_value = HasValue2.has_value, type Output0.output = usize - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, type Output0.output = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel4.shallow_model, + function ShallowModel0.shallow_model = ShallowModel5.shallow_model, predicate InBounds0.in_bounds = InBounds1.in_bounds, predicate HasValue0.has_value = HasValue1.has_value - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = Knapsack_Item_Type.t_item name - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = Knapsack_Item_Type.t_item name, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -945,6 +929,22 @@ module Knapsack_Knapsack01Dyn function ShallowModel0.shallow_model = ShallowModel0.shallow_model, predicate InBounds0.in_bounds = InBounds0.in_bounds, predicate HasValue0.has_value = HasValue0.has_value + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + type self = Alloc_Vec_Vec_Type.t_vec (Knapsack_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with + type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), + type s = Alloc_Vec_Vec_Type.t_vec (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)) (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel1.shallow_model + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve0 with + type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel1.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve5.resolve, + val Max0.mAX' = Max1.mAX' + clone Alloc_Vec_Impl0_WithCapacity_Interface as WithCapacity0 with + type t = Knapsack_Item_Type.t_item name, + function ShallowModel0.shallow_model = ShallowModel4.shallow_model, + val Max0.mAX' = Max1.mAX' clone Knapsack_M as M0 with type name = name, axiom . @@ -1050,7 +1050,7 @@ module Knapsack_Knapsack01Dyn } BB12 { it <- _25; - assume { Resolve0.resolve _25 }; + assume { Resolve2.resolve _25 }; w <- ([#"../knapsack.rs" 64 20 64 21] (0 : usize)); goto BB13 } @@ -1141,14 +1141,14 @@ module Knapsack_Knapsack01Dyn BB32 { _66 <- { _66 with current = _38 }; _38 <- any usize; - assume { Resolve1.resolve _66 }; - assume { Resolve2.resolve _68 }; + assume { Resolve3.resolve _66 }; + assume { Resolve4.resolve _68 }; w <- ([#"../knapsack.rs" 82 12 82 18] w + ([#"../knapsack.rs" 82 17 82 18] (1 : usize))); _19 <- (); goto BB18 } BB33 { - assume { Resolve0.resolve it }; + assume { Resolve2.resolve it }; i <- ([#"../knapsack.rs" 84 8 84 14] i + ([#"../knapsack.rs" 84 13 84 14] (1 : usize))); _19 <- (); goto BB8 @@ -1186,7 +1186,7 @@ module Knapsack_Knapsack01Dyn } BB41 { it1 <- _91; - assume { Resolve0.resolve _91 }; + assume { Resolve2.resolve _91 }; _98 <- ([#"../knapsack.rs" 96 11 96 28] Index1.index best_value ([#"../knapsack.rs" 96 22 96 27] j + ([#"../knapsack.rs" 96 26 96 27] (1 : usize)))); goto BB42 } @@ -1216,13 +1216,13 @@ module Knapsack_Knapsack01Dyn goto BB47 } BB47 { - assume { Resolve0.resolve it1 }; + assume { Resolve2.resolve it1 }; left_weight <- ([#"../knapsack.rs" 98 12 98 36] left_weight - Knapsack_Item_Type.item_weight it1); _19 <- (); goto BB49 } BB48 { - assume { Resolve0.resolve it1 }; + assume { Resolve2.resolve it1 }; _19 <- (); goto BB49 } @@ -1230,8 +1230,8 @@ module Knapsack_Knapsack01Dyn goto BB38 } BB50 { - assume { Resolve3.resolve best_value }; - assume { Resolve4.resolve items }; + assume { Resolve0.resolve best_value }; + assume { Resolve1.resolve items }; _0 <- result; result <- any Alloc_Vec_Vec_Type.t_vec (Knapsack_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global); goto BB51 diff --git a/creusot/tests/should_succeed/knapsack/why3session.xml b/creusot/tests/should_succeed/knapsack/why3session.xml index a4bf8b3bbc..7caf379982 100644 --- a/creusot/tests/should_succeed/knapsack/why3session.xml +++ b/creusot/tests/should_succeed/knapsack/why3session.xml @@ -2,9 +2,9 @@ + - @@ -28,22 +28,22 @@ - + - + - + - + @@ -52,7 +52,7 @@ - + @@ -61,16 +61,16 @@ - + - + - + - + @@ -79,52 +79,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -145,22 +145,22 @@ - + - + - + - + diff --git a/creusot/tests/should_succeed/knapsack/why3shapes.gz b/creusot/tests/should_succeed/knapsack/why3shapes.gz index 34d1386315..617712ae6f 100644 Binary files a/creusot/tests/should_succeed/knapsack/why3shapes.gz and b/creusot/tests/should_succeed/knapsack/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/knapsack_full.mlcfg b/creusot/tests/should_succeed/knapsack_full.mlcfg index c23ee9e536..b99b9c61b1 100644 --- a/creusot/tests/should_succeed/knapsack_full.mlcfg +++ b/creusot/tests/should_succeed/knapsack_full.mlcfg @@ -1280,7 +1280,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -1427,7 +1427,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -1975,13 +1975,23 @@ module KnapsackFull_Knapsack01Dyn type t = Alloc_Vec_Vec_Type.t_vec (KnapsackFull_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq (KnapsackFull_Item_Type.t_item name), function ShallowModel0.shallow_model = ShallowModel3.shallow_model - clone CreusotContracts_Std1_Slice_Impl5_ResolveElswhere as ResolveElswhere1 with - type t = usize clone CreusotContracts_Std1_Vec_Impl0_ShallowModel_Interface as ShallowModel2 with type t = usize, type a = Alloc_Alloc_Global_Type.t_global, val Max0.mAX' = Max1.mAX', axiom . + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic3 with + type t = usize, + type s = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel2.shallow_model + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve7 with + type t = usize, + function ShallowModel0.shallow_model = ShallowModel2.shallow_model, + function IndexLogic0.index_logic = IndexLogic3.index_logic, + predicate Resolve0.resolve = Resolve8.resolve, + val Max0.mAX' = Max1.mAX' + clone CreusotContracts_Std1_Slice_Impl5_ResolveElswhere as ResolveElswhere1 with + type t = usize clone CreusotContracts_Model_Impl7_ShallowModel as ShallowModel8 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq usize, @@ -2013,16 +2023,6 @@ module KnapsackFull_Knapsack01Dyn type t = Alloc_Vec_Vec_Type.t_vec (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)) (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)), function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic3 with - type t = usize, - type s = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel2.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve7 with - type t = usize, - function ShallowModel0.shallow_model = ShallowModel2.shallow_model, - function IndexLogic0.index_logic = IndexLogic3.index_logic, - predicate Resolve0.resolve = Resolve8.resolve, - val Max0.mAX' = Max1.mAX' use prelude.Int clone CreusotContracts_Logic_Ord_Impl2_LeLog as LeLog0 use Core_Ops_Range_RangeInclusive_Type as Core_Ops_Range_RangeInclusive_Type @@ -2133,6 +2133,18 @@ module KnapsackFull_Knapsack01Dyn function ShallowModel0.shallow_model = ShallowModel3.shallow_model, function ShallowModel1.shallow_model = ShallowModel9.shallow_model, val Max0.mAX' = Max1.mAX' + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with + type self = Alloc_Vec_Vec_Type.t_vec (KnapsackFull_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with + type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), + type s = Alloc_Vec_Vec_Type.t_vec (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)) (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel1.shallow_model + clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve5 with + type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), + function ShallowModel0.shallow_model = ShallowModel1.shallow_model, + function IndexLogic0.index_logic = IndexLogic0.index_logic, + predicate Resolve0.resolve = Resolve7.resolve, + val Max0.mAX' = Max1.mAX' clone KnapsackFull_SubseqRev as SubseqRev0 with type t = KnapsackFull_Item_Type.t_item name, axiom . @@ -2150,11 +2162,11 @@ module KnapsackFull_Knapsack01Dyn type t = KnapsackFull_Item_Type.t_item name, function ShallowModel0.shallow_model = ShallowModel3.shallow_model, val Max0.mAX' = Max1.mAX' - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve6 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve5 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = usize - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut1 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut1 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2165,7 +2177,7 @@ module KnapsackFull_Knapsack01Dyn predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere1.resolve_elswhere, type Output0.output = usize, val Max0.mAX' = Max1.mAX' - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2177,7 +2189,7 @@ module KnapsackFull_Knapsack01Dyn predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere0.resolve_elswhere, val Max0.mAX' = Max1.mAX' clone KnapsackFull_Max_Interface as Max0 - clone Alloc_Vec_Impl13_Index_Interface as Index2 with + clone Alloc_Vec_Impl12_Index_Interface as Index2 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2185,7 +2197,7 @@ module KnapsackFull_Knapsack01Dyn predicate InBounds0.in_bounds = InBounds2.in_bounds, predicate HasValue0.has_value = HasValue2.has_value, type Output0.output = usize - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2193,18 +2205,6 @@ module KnapsackFull_Knapsack01Dyn function ShallowModel0.shallow_model = ShallowModel5.shallow_model, predicate InBounds0.in_bounds = InBounds1.in_bounds, predicate HasValue0.has_value = HasValue1.has_value - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with - type self = Alloc_Vec_Vec_Type.t_vec (KnapsackFull_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Logic_Ops_Impl0_IndexLogic as IndexLogic0 with - type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - type s = Alloc_Vec_Vec_Type.t_vec (Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global)) (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone CreusotContracts_Std1_Vec_Impl10_Resolve as Resolve3 with - type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), - function ShallowModel0.shallow_model = ShallowModel1.shallow_model, - function IndexLogic0.index_logic = IndexLogic0.index_logic, - predicate Resolve0.resolve = Resolve7.resolve, - val Max0.mAX' = Max1.mAX' clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = Core_Ops_Range_RangeInclusive_Type.t_rangeinclusive usize use Core_Option_Option_Type as Core_Option_Option_Type @@ -2228,7 +2228,7 @@ module KnapsackFull_Knapsack01Dyn type DeepModelTy0.deepModelTy = int clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = KnapsackFull_Item_Type.t_item name - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = KnapsackFull_Item_Type.t_item name, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2546,8 +2546,8 @@ module KnapsackFull_Knapsack01Dyn BB48 { _94 <- { _94 with current = _66 }; _66 <- any usize; - assume { Resolve5.resolve _94 }; - assume { Resolve6.resolve _96 }; + assume { Resolve3.resolve _94 }; + assume { Resolve4.resolve _96 }; _31 <- (); goto BB30 } @@ -2637,8 +2637,8 @@ module KnapsackFull_Knapsack01Dyn goto BB55 } BB67 { - assume { Resolve3.resolve best_value }; - assume { Resolve4.resolve items }; + assume { Resolve5.resolve best_value }; + assume { Resolve6.resolve items }; _0 <- result; result <- any Alloc_Vec_Vec_Type.t_vec (KnapsackFull_Item_Type.t_item name) (Alloc_Alloc_Global_Type.t_global); goto BB68 @@ -2650,14 +2650,14 @@ module KnapsackFull_Knapsack01Dyn return _0 } BB74 { - assume { Resolve3.resolve best_value }; - assume { Resolve4.resolve items }; + assume { Resolve5.resolve best_value }; + assume { Resolve6.resolve items }; goto BB17 } BB75 { assume { Resolve1.resolve it }; - assume { Resolve3.resolve best_value }; - assume { Resolve4.resolve items }; + assume { Resolve5.resolve best_value }; + assume { Resolve6.resolve items }; goto BB17 } diff --git a/creusot/tests/should_succeed/knapsack_full/why3session.xml b/creusot/tests/should_succeed/knapsack_full/why3session.xml index 9bf2a7bbab..73f18cc066 100644 --- a/creusot/tests/should_succeed/knapsack_full/why3session.xml +++ b/creusot/tests/should_succeed/knapsack_full/why3session.xml @@ -3,8 +3,8 @@ "http://why3.lri.fr/why3session.dtd"> + - @@ -46,19 +46,19 @@ - + - + - + - + @@ -94,40 +94,40 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -136,31 +136,31 @@ - + - + - + - + - + - + @@ -172,64 +172,64 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/creusot/tests/should_succeed/knapsack_full/why3shapes.gz b/creusot/tests/should_succeed/knapsack_full/why3shapes.gz index d5841ed0e1..b30b97fd27 100644 Binary files a/creusot/tests/should_succeed/knapsack_full/why3shapes.gz and b/creusot/tests/should_succeed/knapsack_full/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/list_index_mut.mlcfg b/creusot/tests/should_succeed/list_index_mut.mlcfg index 9a4239cc19..e8224f1360 100644 --- a/creusot/tests/should_succeed/list_index_mut.mlcfg +++ b/creusot/tests/should_succeed/list_index_mut.mlcfg @@ -17,14 +17,14 @@ module ListIndexMut_List_Type type t_list = | C_List uint32 (ListIndexMut_Option_Type.t_option (t_list)) - let function list_1 (self : t_list) : ListIndexMut_Option_Type.t_option (t_list) = [@vc:do_not_keep_trace] [@vc:sp] - match (self) with - | C_List _ a -> a - end let function list_0 (self : t_list) : uint32 = [@vc:do_not_keep_trace] [@vc:sp] match (self) with | C_List a _ -> a end + let function list_1 (self : t_list) : ListIndexMut_Option_Type.t_option (t_list) = [@vc:do_not_keep_trace] [@vc:sp] + match (self) with + | C_List _ a -> a + end end module ListIndexMut_Len_Stub use prelude.Int @@ -137,11 +137,11 @@ module ListIndexMut_IndexMut use prelude.UIntSize use prelude.UInt32 use ListIndexMut_Option_Type as ListIndexMut_Option_Type - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = uint32 use ListIndexMut_List_Type as ListIndexMut_List_Type - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = ListIndexMut_List_Type.t_list + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = uint32 clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = ListIndexMut_List_Type.t_list clone ListIndexMut_Get as Get0 @@ -216,7 +216,7 @@ module ListIndexMut_IndexMut assume { Resolve0.resolve l }; l <- _25; _25 <- any borrowed (ListIndexMut_List_Type.t_list); - assume { Resolve1.resolve n }; + assume { Resolve2.resolve n }; ix <- ([#"../list_index_mut.rs" 63 8 63 15] ix - ([#"../list_index_mut.rs" 63 14 63 15] (1 : usize))); goto BB2 } @@ -228,8 +228,8 @@ module ListIndexMut_IndexMut assume { Resolve0.resolve l }; _0 <- borrow_mut ( * _3); _3 <- { _3 with current = ( ^ _0) }; - assume { Resolve2.resolve _30 }; - assume { Resolve2.resolve _3 }; + assume { Resolve1.resolve _30 }; + assume { Resolve1.resolve _3 }; return _0 } diff --git a/creusot/tests/should_succeed/list_index_mut/why3shapes.gz b/creusot/tests/should_succeed/list_index_mut/why3shapes.gz index af9b84db67..2fc8b824e7 100644 Binary files a/creusot/tests/should_succeed/list_index_mut/why3shapes.gz and b/creusot/tests/should_succeed/list_index_mut/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/list_reversal_lasso.mlcfg b/creusot/tests/should_succeed/list_reversal_lasso.mlcfg index 6c187210ae..b54ac9ff8f 100644 --- a/creusot/tests/should_succeed/list_reversal_lasso.mlcfg +++ b/creusot/tests/should_succeed/list_reversal_lasso.mlcfg @@ -346,7 +346,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -475,7 +475,7 @@ module ListReversalLasso_Impl1_Index clone ListReversalLasso_Impl3_NonnullPtr as NonnullPtr0 with function ShallowModel0.shallow_model = ShallowModel1.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -590,7 +590,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -722,7 +722,7 @@ module ListReversalLasso_Impl2_IndexMut type t = ListReversalLasso_Memory_Type.t_memory clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = usize - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -832,8 +832,6 @@ module ListReversalLasso_Impl4_ListReversalSafe clone ListReversalLasso_Impl0_IndexLogic as IndexLogic0 with function IndexLogic0.index_logic = IndexLogic1.index_logic clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = ListReversalLasso_Memory_Type.t_memory - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = usize clone ListReversalLasso_Impl3_NonnullPtr as NonnullPtr0 with function ShallowModel0.shallow_model = ShallowModel0.shallow_model, @@ -846,6 +844,8 @@ module ListReversalLasso_Impl4_ListReversalSafe clone ListReversalLasso_Impl1_Index_Interface as Index0 with predicate NonnullPtr0.nonnull_ptr = NonnullPtr0.nonnull_ptr, function IndexLogic0.index_logic = IndexLogic0.index_logic + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = ListReversalLasso_Memory_Type.t_memory clone ListReversalLasso_Null as Null0 clone ListReversalLasso_Impl3_MemIsWellFormed as MemIsWellFormed0 with predicate NonnullPtr0.nonnull_ptr = NonnullPtr0.nonnull_ptr, @@ -898,12 +898,12 @@ module ListReversalLasso_Impl4_ListReversalSafe } BB5 { _20 <- { _20 with current = r }; - assume { Resolve0.resolve _20 }; + assume { Resolve1.resolve _20 }; r <- tmp; goto BB1 } BB6 { - assume { Resolve1.resolve self }; + assume { Resolve0.resolve self }; _0 <- r; return _0 } @@ -1040,17 +1040,17 @@ module ListReversalLasso_Impl4_ListReversalList clone ListReversalLasso_Impl4_List as List0 with val Null0.nULL' = Null0.nULL', predicate ListSeg0.list_seg = ListSeg0.list_seg - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = ListReversalLasso_Memory_Type.t_memory clone Core_Mem_Replace_Interface as Replace0 with type t = usize - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = usize clone ListReversalLasso_Impl2_IndexMut_Interface as IndexMut0 with predicate NonnullPtr0.nonnull_ptr = NonnullPtr0.nonnull_ptr, function IndexLogic0.index_logic = IndexLogic0.index_logic, function ShallowModel0.shallow_model = ShallowModel0.shallow_model, val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = ListReversalLasso_Memory_Type.t_memory let rec cfg list_reversal_list [#"../list_reversal_lasso.rs" 99 4 99 79] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (ListReversalLasso_Memory_Type.t_memory)) (l : usize) (s : Ghost.ghost_ty (Seq.seq usize)) : usize requires {[#"../list_reversal_lasso.rs" 97 15 97 31] List0.list ( * self) l (Ghost.inner s)} ensures { [#"../list_reversal_lasso.rs" 98 14 98 47] List0.list ( ^ self) result (Reverse.reverse (Ghost.inner s)) } @@ -1111,12 +1111,12 @@ module ListReversalLasso_Impl4_ListReversalList goto BB6 } BB6 { - assume { Resolve0.resolve _25 }; + assume { Resolve1.resolve _25 }; goto BB7 } BB7 { - assume { Resolve0.resolve _20 }; - assume { Resolve0.resolve _19 }; + assume { Resolve1.resolve _20 }; + assume { Resolve1.resolve _19 }; l <- ([#"../list_reversal_lasso.rs" 108 16 108 77] Replace0.replace _18 ([#"../list_reversal_lasso.rs" 108 48 108 76] Replace0.replace _24 l)); _18 <- any borrowed usize; _24 <- any borrowed usize; @@ -1129,7 +1129,7 @@ module ListReversalLasso_Impl4_ListReversalList goto BB2 } BB9 { - assume { Resolve1.resolve self }; + assume { Resolve0.resolve self }; _0 <- r; return _0 } @@ -1246,17 +1246,17 @@ module ListReversalLasso_Impl4_ListReversalLoop function IndexLogic0.index_logic = IndexLogic1.index_logic clone ListReversalLasso_Impl4_Loop as Loop0 with predicate ListSeg0.list_seg = ListSeg0.list_seg - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = ListReversalLasso_Memory_Type.t_memory clone Core_Mem_Replace_Interface as Replace0 with type t = usize - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = usize clone ListReversalLasso_Impl2_IndexMut_Interface as IndexMut0 with predicate NonnullPtr0.nonnull_ptr = NonnullPtr0.nonnull_ptr, function IndexLogic0.index_logic = IndexLogic1.index_logic, function ShallowModel0.shallow_model = ShallowModel0.shallow_model, val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = ListReversalLasso_Memory_Type.t_memory clone CreusotContracts_Logic_Ops_Impl2_IndexLogic as IndexLogic0 with type t = usize clone ListReversalLasso_Null as Null0 @@ -1323,12 +1323,12 @@ module ListReversalLasso_Impl4_ListReversalLoop goto BB6 } BB6 { - assume { Resolve0.resolve _29 }; + assume { Resolve1.resolve _29 }; goto BB7 } BB7 { - assume { Resolve0.resolve _24 }; - assume { Resolve0.resolve _23 }; + assume { Resolve1.resolve _24 }; + assume { Resolve1.resolve _23 }; l <- ([#"../list_reversal_lasso.rs" 139 16 139 77] Replace0.replace _22 ([#"../list_reversal_lasso.rs" 139 48 139 76] Replace0.replace _28 l)); _22 <- any borrowed usize; _28 <- any borrowed usize; @@ -1341,7 +1341,7 @@ module ListReversalLasso_Impl4_ListReversalLoop goto BB2 } BB9 { - assume { Resolve1.resolve self }; + assume { Resolve0.resolve self }; assert { [@expl:assertion] [#"../list_reversal_lasso.rs" 143 8 145 54] forall i : int . 0 <= i /\ i < Seq.length (Ghost.inner s) -> Seq.get (Seq.(++) (Seq.singleton (IndexLogic0.index_logic s 0)) (Reverse.reverse (SeqExt.subsequence (Ghost.inner s) 1 (Seq.length (Ghost.inner s))))) i = (if i = 0 then IndexLogic0.index_logic s 0 else @@ -1434,17 +1434,17 @@ module ListReversalLasso_Impl4_ListReversalLasso function IndexLogic0.index_logic = IndexLogic1.index_logic clone ListReversalLasso_Impl4_Lasso as Lasso0 with predicate ListSeg0.list_seg = ListSeg0.list_seg - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = ListReversalLasso_Memory_Type.t_memory clone Core_Mem_Replace_Interface as Replace0 with type t = usize - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = usize clone ListReversalLasso_Impl2_IndexMut_Interface as IndexMut0 with predicate NonnullPtr0.nonnull_ptr = NonnullPtr0.nonnull_ptr, function IndexLogic0.index_logic = IndexLogic1.index_logic, function ShallowModel0.shallow_model = ShallowModel0.shallow_model, val Max0.mAX' = Max0.mAX' + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = ListReversalLasso_Memory_Type.t_memory clone ListReversalLasso_Null as Null0 clone CreusotContracts_Logic_Ops_Impl2_IndexLogic as IndexLogic0 with type t = usize @@ -1518,12 +1518,12 @@ module ListReversalLasso_Impl4_ListReversalLasso goto BB6 } BB6 { - assume { Resolve0.resolve _27 }; + assume { Resolve1.resolve _27 }; goto BB7 } BB7 { - assume { Resolve0.resolve _22 }; - assume { Resolve0.resolve _21 }; + assume { Resolve1.resolve _22 }; + assume { Resolve1.resolve _21 }; l <- ([#"../list_reversal_lasso.rs" 191 16 191 77] Replace0.replace _20 ([#"../list_reversal_lasso.rs" 191 48 191 76] Replace0.replace _26 l)); _20 <- any borrowed usize; _26 <- any borrowed usize; @@ -1536,7 +1536,7 @@ module ListReversalLasso_Impl4_ListReversalLasso goto BB2 } BB9 { - assume { Resolve1.resolve self }; + assume { Resolve0.resolve self }; _0 <- r; return _0 } diff --git a/creusot/tests/should_succeed/list_reversal_lasso/why3session.xml b/creusot/tests/should_succeed/list_reversal_lasso/why3session.xml index cbcab4e2b4..adcfcb79c6 100644 --- a/creusot/tests/should_succeed/list_reversal_lasso/why3session.xml +++ b/creusot/tests/should_succeed/list_reversal_lasso/why3session.xml @@ -4,6 +4,7 @@ + @@ -36,7 +37,7 @@ - + @@ -45,10 +46,10 @@ - + - + @@ -69,7 +70,7 @@ - + @@ -82,24 +83,24 @@ - + - + - + - + @@ -112,7 +113,7 @@ - + @@ -121,15 +122,15 @@ - + - + - + @@ -159,15 +160,15 @@ - + - + - + @@ -178,31 +179,31 @@ - + - + - + - + - + @@ -211,7 +212,7 @@ - + @@ -223,47 +224,47 @@ - + - + - + - + - + - + - + - + - + @@ -276,40 +277,40 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -322,7 +323,7 @@ - + @@ -334,7 +335,7 @@ - + @@ -347,14 +348,14 @@ - + - + @@ -365,7 +366,7 @@ - + @@ -377,7 +378,7 @@ - + @@ -386,10 +387,10 @@ - + - + @@ -400,16 +401,16 @@ - + - + - + - + diff --git a/creusot/tests/should_succeed/list_reversal_lasso/why3shapes.gz b/creusot/tests/should_succeed/list_reversal_lasso/why3shapes.gz index f31360e529..211bc57e59 100644 Binary files a/creusot/tests/should_succeed/list_reversal_lasso/why3shapes.gz and b/creusot/tests/should_succeed/list_reversal_lasso/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/projections.mlcfg b/creusot/tests/should_succeed/projections.mlcfg index 0210830545..fb9211ba07 100644 --- a/creusot/tests/should_succeed/projections.mlcfg +++ b/creusot/tests/should_succeed/projections.mlcfg @@ -28,16 +28,16 @@ module Core_Result_Result_Type | C_Ok 't | C_Err 'e - let function err_0 (self : t_result 't 'e) : 'e = [@vc:do_not_keep_trace] [@vc:sp] - match (self) with - | C_Ok _ -> any 'e - | C_Err a -> a - end let function ok_0 (self : t_result 't 'e) : 't = [@vc:do_not_keep_trace] [@vc:sp] match (self) with | C_Ok a -> a | C_Err _ -> any 't end + let function err_0 (self : t_result 't 'e) : 'e = [@vc:do_not_keep_trace] [@vc:sp] + match (self) with + | C_Ok _ -> any 'e + | C_Err a -> a + end end module CreusotContracts_Resolve_Impl1_Resolve_Stub type t @@ -139,11 +139,11 @@ module Projections_WriteIntoSum use prelude.Int use prelude.UInt32 use prelude.Borrow - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = uint32 use Core_Option_Option_Type as Core_Option_Option_Type - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = Core_Option_Option_Type.t_option uint32 + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = uint32 let rec cfg write_into_sum [#"../projections.rs" 16 0 16 42] [@cfg:stackify] [@cfg:subregion_analysis] (x : borrowed (Core_Option_Option_Type.t_option uint32)) : () = [@vc:do_not_keep_trace] [@vc:sp] @@ -160,7 +160,7 @@ module Projections_WriteIntoSum end } BB1 { - assume { Resolve0.resolve x }; + assume { Resolve1.resolve x }; _0 <- (); goto BB5 } @@ -168,16 +168,16 @@ module Projections_WriteIntoSum goto BB4 } BB3 { - assume { Resolve0.resolve x }; + assume { Resolve1.resolve x }; absurd } BB4 { y <- borrow_mut (Core_Option_Option_Type.some_0 ( * x)); x <- { x with current = (let Core_Option_Option_Type.C_Some a = * x in Core_Option_Option_Type.C_Some ( ^ y)) }; y <- { y with current = ([#"../projections.rs" 18 24 18 26] (10 : uint32)) }; - assume { Resolve1.resolve y }; + assume { Resolve0.resolve y }; _0 <- (); - assume { Resolve0.resolve x }; + assume { Resolve1.resolve x }; goto BB5 } BB5 { diff --git a/creusot/tests/should_succeed/red_black_tree.mlcfg b/creusot/tests/should_succeed/red_black_tree.mlcfg index 269730e228..89034e2971 100644 --- a/creusot/tests/should_succeed/red_black_tree.mlcfg +++ b/creusot/tests/should_succeed/red_black_tree.mlcfg @@ -3612,8 +3612,6 @@ module RedBlackTree_Impl14_Balance type v = v, predicate BstInvariant0.bst_invariant = BstInvariant0.bst_invariant, predicate HeightInvariant0.height_invariant = HeightInvariant0.height_invariant - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl14_FlipColors_Interface as FlipColors0 with type k = k, type v = v, @@ -3622,6 +3620,8 @@ module RedBlackTree_Impl14_Balance function Height0.height = Height0.height, predicate SameMappings0.same_mappings = SameMappings0.same_mappings, function Height1.height = Height1.height + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl14_RotateRight_Interface as RotateRight0 with type k = k, type v = v, @@ -4931,6 +4931,8 @@ module RedBlackTree_Impl15_InsertRec type v = v, predicate BstInvariant0.bst_invariant = BstInvariant0.bst_invariant, predicate HeightInvariant0.height_invariant = HeightInvariant0.height_invariant + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with + type self = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) clone RedBlackTree_Impl14_Balance_Interface as Balance0 with type k = k, type v = v, @@ -4942,25 +4944,23 @@ module RedBlackTree_Impl15_InsertRec function Cpn0.cpn = Cpn0.cpn, predicate MatchN0.match_n = MatchN0.match_n, function Height1.height = Height0.height - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with - type self = k - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with - type self = v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve5 with + type t = RedBlackTree_Tree_Type.t_tree k v clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = RedBlackTree_Node_Type.t_node k v + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + type self = v + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + type self = k clone Core_Cmp_Ord_Cmp_Interface as Cmp0 with type self = k, function DeepModel0.deep_model = DeepModel0.deep_model, function CmpLog0.cmp_log = CmpLog0.cmp_log, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = k - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = RedBlackTree_Tree_Type.t_tree k v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with - type self = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) let rec cfg insert_rec [#"../red_black_tree.rs" 600 4 600 44] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (RedBlackTree_Tree_Type.t_tree k v)) (key : k) (val' : v) : () requires {[#"../red_black_tree.rs" 592 15 592 43] InternalInvariant0.internal_invariant ( * self)} requires {[#"../red_black_tree.rs" 593 15 593 40] ColorInvariant0.color_invariant ( * self)} @@ -5007,7 +5007,7 @@ module RedBlackTree_Impl15_InsertRec node <- borrow_mut (Core_Option_Option_Type.some_0 ( * _11)); _11 <- { _11 with current = (let Core_Option_Option_Type.C_Some a = * _11 in Core_Option_Option_Type.C_Some ( ^ node)) }; _18 <- RedBlackTree_Node_Type.node_key ( * node); - assume { Resolve3.resolve _18 }; + assume { Resolve0.resolve _18 }; goto BB5 } BB5 { @@ -5033,11 +5033,11 @@ module RedBlackTree_Impl15_InsertRec goto BB16 } BB9 { - assume { Resolve4.resolve node }; - assume { Resolve5.resolve val' }; - assume { Resolve6.resolve key }; - assume { Resolve0.resolve _11 }; - assume { Resolve2.resolve self }; + assume { Resolve3.resolve node }; + assume { Resolve2.resolve val' }; + assume { Resolve1.resolve key }; + assume { Resolve4.resolve _11 }; + assume { Resolve5.resolve self }; absurd } BB10 { @@ -5053,19 +5053,19 @@ module RedBlackTree_Impl15_InsertRec goto BB17 } BB12 { - assume { Resolve6.resolve key }; + assume { Resolve1.resolve key }; goto BB13 } BB13 { node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a b c val' e) }; val' <- any v; - assume { Resolve5.resolve (RedBlackTree_Node_Type.node_val ( * node)) }; - assume { Resolve4.resolve node }; + assume { Resolve2.resolve (RedBlackTree_Node_Type.node_val ( * node)) }; + assume { Resolve3.resolve node }; goto BB15 } BB15 { - assume { Resolve0.resolve _11 }; - assume { Resolve2.resolve self }; + assume { Resolve4.resolve _11 }; + assume { Resolve5.resolve self }; _0 <- (); goto BB32 } @@ -5080,14 +5080,14 @@ module RedBlackTree_Impl15_InsertRec goto BB18 } BB18 { - assume { Resolve4.resolve node }; - assume { Resolve0.resolve _11 }; - assume { Resolve2.resolve self }; + assume { Resolve3.resolve node }; + assume { Resolve4.resolve _11 }; + assume { Resolve5.resolve self }; _0 <- (); goto BB31 } BB19 { - assume { Resolve0.resolve _11 }; + assume { Resolve4.resolve _11 }; goto BB20 } BB20 { @@ -5118,8 +5118,8 @@ module RedBlackTree_Impl15_InsertRec self <- { self with current = (let RedBlackTree_Tree_Type.C_Tree a = * self in RedBlackTree_Tree_Type.C_Tree (Core_Option_Option_Type.C_Some (RedBlackTree_Node_Type.C_Node (RedBlackTree_Tree_Type.C_Tree (Core_Option_Option_Type.C_None)) (RedBlackTree_Color_Type.C_Red) key val' (RedBlackTree_Tree_Type.C_Tree (Core_Option_Option_Type.C_None))))) }; key <- any k; val' <- any v; - assume { Resolve1.resolve (RedBlackTree_Tree_Type.tree_node ( * self)) }; - assume { Resolve2.resolve self }; + assume { Resolve6.resolve (RedBlackTree_Tree_Type.tree_node ( * self)) }; + assume { Resolve5.resolve self }; goto BB30 } BB30 { @@ -5648,8 +5648,6 @@ module RedBlackTree_Impl15_DeleteMaxRec function LeLog0.le_log = LeLog0.le_log, function CmpLog0.cmp_log = CmpLog0.cmp_log, axiom . - clone CreusotContracts_Std1_Option_Impl1_IsDefault as IsDefault0 with - type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl7_ColorInvariant as ColorInvariant0 with type k = k, type v = v, @@ -5677,6 +5675,8 @@ module RedBlackTree_Impl15_DeleteMaxRec type v = v, predicate ColorInvariant0.color_invariant = ColorInvariant1.color_invariant, predicate MatchT0.match_t = MatchT0.match_t + clone CreusotContracts_Std1_Option_Impl1_IsDefault as IsDefault0 with + type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl10_Height as Height1 with type k = k, type v = v, @@ -5700,17 +5700,6 @@ module RedBlackTree_Impl15_DeleteMaxRec type v = v, predicate BstInvariant0.bst_invariant = BstInvariant0.bst_invariant, predicate HeightInvariant0.height_invariant = HeightInvariant0.height_invariant - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with - type self = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_Unwrap_Interface as Unwrap2 with - type t = RedBlackTree_Node_Type.t_node k v - clone Core_Mem_Take_Interface as Take0 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v), - predicate IsDefault0.is_default = IsDefault0.is_default - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with - type t = RedBlackTree_Tree_Type.t_tree k v clone RedBlackTree_Impl14_Balance_Interface as Balance0 with type k = k, type v = v, @@ -5722,8 +5711,6 @@ module RedBlackTree_Impl15_DeleteMaxRec function Cpn0.cpn = Cpn0.cpn, predicate MatchN0.match_n = MatchN0.match_n, function Height1.height = Height0.height - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl14_MoveRedRight_Interface as MoveRedRight0 with type k = k, type v = v, @@ -5739,12 +5726,25 @@ module RedBlackTree_Impl15_DeleteMaxRec function Color0.color = Color0.color, function Height1.height = Height0.height, predicate HasMapping1.has_mapping = HasMapping0.has_mapping - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with type self = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_Unwrap_Interface as Unwrap1 with + clone Core_Option_Impl0_Unwrap_Interface as Unwrap2 with type t = RedBlackTree_Node_Type.t_node k v clone Core_Option_Impl0_AsRef_Interface as AsRef0 with type t = RedBlackTree_Node_Type.t_node k v + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with + type self = RedBlackTree_Node_Type.t_node k v + clone Core_Option_Impl0_Unwrap_Interface as Unwrap1 with + type t = RedBlackTree_Node_Type.t_node k v + clone Core_Mem_Take_Interface as Take0 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v), + predicate IsDefault0.is_default = IsDefault0.is_default + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = RedBlackTree_Tree_Type.t_tree k v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl14_RotateRight_Interface as RotateRight0 with type k = k, type v = v, @@ -5856,7 +5856,7 @@ module RedBlackTree_Impl15_DeleteMaxRec goto BB10 } BB10 { - assume { Resolve2.resolve node }; + assume { Resolve1.resolve node }; _26 <- borrow_mut (RedBlackTree_Tree_Type.tree_node ( * self)); self <- { self with current = (let RedBlackTree_Tree_Type.C_Tree a = * self in RedBlackTree_Tree_Type.C_Tree ( ^ _26)) }; _25 <- borrow_mut ( * _26); @@ -5864,14 +5864,14 @@ module RedBlackTree_Impl15_DeleteMaxRec goto BB11 } BB11 { - assume { Resolve4.resolve _26 }; + assume { Resolve2.resolve _26 }; assume { Resolve3.resolve self }; - node1 <- ([#"../red_black_tree.rs" 649 23 649 62] Unwrap2.unwrap ([#"../red_black_tree.rs" 649 23 649 53] Take0.take _25)); + node1 <- ([#"../red_black_tree.rs" 649 23 649 62] Unwrap1.unwrap ([#"../red_black_tree.rs" 649 23 649 53] Take0.take _25)); _25 <- any borrowed (Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v)); goto BB12 } BB12 { - assume { Resolve5.resolve node1 }; + assume { Resolve4.resolve node1 }; _0 <- (RedBlackTree_Node_Type.node_key node1, RedBlackTree_Node_Type.node_val node1); node1 <- (let RedBlackTree_Node_Type.C_Node a b c d e = node1 in RedBlackTree_Node_Type.C_Node a b (any k) d e); node1 <- (let RedBlackTree_Node_Type.C_Node a b c d e = node1 in RedBlackTree_Node_Type.C_Node a b c (any v) e); @@ -5906,11 +5906,11 @@ module RedBlackTree_Impl15_DeleteMaxRec end } BB20 { - _37 <- ([#"../red_black_tree.rs" 652 36 652 69] Unwrap1.unwrap ([#"../red_black_tree.rs" 652 36 652 60] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_right ( * node))))); + _37 <- ([#"../red_black_tree.rs" 652 36 652 69] Unwrap2.unwrap ([#"../red_black_tree.rs" 652 36 652 60] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_right ( * node))))); goto BB21 } BB21 { - assume { Resolve1.resolve _37 }; + assume { Resolve5.resolve _37 }; goto BB22 } BB22 { @@ -5927,10 +5927,10 @@ module RedBlackTree_Impl15_DeleteMaxRec BB24 { _40 <- borrow_mut ( * _41); _41 <- { _41 with current = ( ^ _40) }; - assume { Resolve2.resolve node }; + assume { Resolve1.resolve node }; node <- _40; _40 <- any borrowed (RedBlackTree_Node_Type.t_node k v); - assume { Resolve2.resolve _41 }; + assume { Resolve1.resolve _41 }; _29 <- (); goto BB26 } @@ -5953,7 +5953,7 @@ module RedBlackTree_Impl15_DeleteMaxRec goto BB28 } BB28 { - assume { Resolve2.resolve node }; + assume { Resolve1.resolve node }; assume { Resolve3.resolve self }; _0 <- r; r <- any (k, v); @@ -6180,6 +6180,8 @@ module RedBlackTree_Impl15_DeleteMax type t = borrowed (RedBlackTree_Node_Type.t_node k v) clone Core_Option_Impl0_AsMut_Interface as AsMut0 with type t = RedBlackTree_Node_Type.t_node k v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = RedBlackTree_Tree_Type.t_tree k v clone RedBlackTree_Impl15_DeleteMaxRec_Interface as DeleteMaxRec0 with type k = k, type v = v, @@ -6198,16 +6200,14 @@ module RedBlackTree_Impl15_DeleteMax type v = v, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, predicate HasMapping0.has_mapping = HasMapping0.has_mapping - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl13_IsRed_Interface as IsRed0 with type k = k, type v = v, function Color0.color = Color0.color - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = RedBlackTree_Tree_Type.t_tree k v - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = Ghost.ghost_ty (borrowed (RedBlackTree_Tree_Type.t_tree k v)) let rec cfg delete_max [#"../red_black_tree.rs" 667 4 667 50] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (RedBlackTree_Tree_Type.t_tree k v)) : Core_Option_Option_Type.t_option (k, v) @@ -6263,15 +6263,15 @@ module RedBlackTree_Impl15_DeleteMax } BB5 { node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a (RedBlackTree_Color_Type.C_Red) c d e) }; - assume { Resolve3.resolve node }; - assume { Resolve1.resolve _8 }; + assume { Resolve1.resolve node }; + assume { Resolve2.resolve _8 }; _7 <- (); goto BB7 } BB6 { - assume { Resolve3.resolve node }; + assume { Resolve1.resolve node }; _7 <- (); - assume { Resolve1.resolve _8 }; + assume { Resolve2.resolve _8 }; goto BB7 } BB7 { @@ -6283,9 +6283,9 @@ module RedBlackTree_Impl15_DeleteMax goto BB9 } BB8 { - assume { Resolve1.resolve _8 }; + assume { Resolve2.resolve _8 }; _0 <- Core_Option_Option_Type.C_None; - assume { Resolve2.resolve self }; + assume { Resolve3.resolve self }; goto BB19 } BB9 { @@ -6309,13 +6309,13 @@ module RedBlackTree_Impl15_DeleteMax } BB13 { _24 <- { _24 with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * _24 in RedBlackTree_Node_Type.C_Node a (RedBlackTree_Color_Type.C_Black) c d e) }; - assume { Resolve3.resolve _24 }; - assume { Resolve2.resolve self }; + assume { Resolve1.resolve _24 }; + assume { Resolve3.resolve self }; _20 <- (); goto BB15 } BB14 { - assume { Resolve2.resolve self }; + assume { Resolve3.resolve self }; _20 <- (); goto BB15 } @@ -6496,8 +6496,6 @@ module RedBlackTree_Impl15_DeleteMinRec function LeLog0.le_log = LeLog0.le_log, function CmpLog0.cmp_log = CmpLog0.cmp_log, axiom . - clone CreusotContracts_Std1_Option_Impl1_IsDefault as IsDefault0 with - type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl1_HasMapping as HasMapping1 with type k = k, type v = v, @@ -6541,6 +6539,8 @@ module RedBlackTree_Impl15_DeleteMinRec type v = v, predicate BstInvariant0.bst_invariant = BstInvariant1.bst_invariant, predicate HeightInvariant0.height_invariant = HeightInvariant1.height_invariant + clone CreusotContracts_Std1_Option_Impl1_IsDefault as IsDefault0 with + type t = RedBlackTree_Node_Type.t_node k v use Alloc_Alloc_Global_Type as Alloc_Alloc_Global_Type clone RedBlackTree_Cpn as Cpn0 clone RedBlackTree_Impl11_InternalInvariant as InternalInvariant0 with @@ -6548,17 +6548,6 @@ module RedBlackTree_Impl15_DeleteMinRec type v = v, predicate BstInvariant0.bst_invariant = BstInvariant0.bst_invariant, predicate HeightInvariant0.height_invariant = HeightInvariant0.height_invariant - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with - type self = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_Unwrap_Interface as Unwrap2 with - type t = RedBlackTree_Node_Type.t_node k v - clone Core_Mem_Take_Interface as Take0 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v), - predicate IsDefault0.is_default = IsDefault0.is_default - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with - type t = RedBlackTree_Tree_Type.t_tree k v clone RedBlackTree_Impl14_Balance_Interface as Balance0 with type k = k, type v = v, @@ -6570,8 +6559,6 @@ module RedBlackTree_Impl15_DeleteMinRec function Cpn0.cpn = Cpn0.cpn, predicate MatchN0.match_n = MatchN0.match_n, function Height1.height = Height0.height - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl14_MoveRedLeft_Interface as MoveRedLeft0 with type k = k, type v = v, @@ -6587,9 +6574,9 @@ module RedBlackTree_Impl15_DeleteMinRec function Color0.color = Color0.color, function Height1.height = Height0.height, predicate HasMapping1.has_mapping = HasMapping0.has_mapping - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with type self = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_Unwrap_Interface as Unwrap1 with + clone Core_Option_Impl0_Unwrap_Interface as Unwrap2 with type t = RedBlackTree_Node_Type.t_node k v clone Core_Option_Impl0_AsRef_Interface as AsRef0 with type t = RedBlackTree_Node_Type.t_node k v @@ -6597,6 +6584,19 @@ module RedBlackTree_Impl15_DeleteMinRec type k = k, type v = v, function Color0.color = Color0.color + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with + type self = RedBlackTree_Node_Type.t_node k v + clone Core_Option_Impl0_Unwrap_Interface as Unwrap1 with + type t = RedBlackTree_Node_Type.t_node k v + clone Core_Mem_Take_Interface as Take0 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v), + predicate IsDefault0.is_default = IsDefault0.is_default + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = RedBlackTree_Tree_Type.t_tree k v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = RedBlackTree_Node_Type.t_node k v clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = RedBlackTree_Node_Type.t_node k v clone Alloc_Boxed_Impl57_AsMut_Interface as AsMut1 with @@ -6668,7 +6668,7 @@ module RedBlackTree_Impl15_DeleteMinRec goto BB5 } BB5 { - assume { Resolve2.resolve node }; + assume { Resolve1.resolve node }; _22 <- borrow_mut (RedBlackTree_Tree_Type.tree_node ( * self)); self <- { self with current = (let RedBlackTree_Tree_Type.C_Tree a = * self in RedBlackTree_Tree_Type.C_Tree ( ^ _22)) }; _21 <- borrow_mut ( * _22); @@ -6676,14 +6676,14 @@ module RedBlackTree_Impl15_DeleteMinRec goto BB6 } BB6 { - assume { Resolve4.resolve _22 }; + assume { Resolve2.resolve _22 }; assume { Resolve3.resolve self }; - node1 <- ([#"../red_black_tree.rs" 699 23 699 62] Unwrap2.unwrap ([#"../red_black_tree.rs" 699 23 699 53] Take0.take _21)); + node1 <- ([#"../red_black_tree.rs" 699 23 699 62] Unwrap1.unwrap ([#"../red_black_tree.rs" 699 23 699 53] Take0.take _21)); _21 <- any borrowed (Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v)); goto BB7 } BB7 { - assume { Resolve5.resolve node1 }; + assume { Resolve4.resolve node1 }; _0 <- (RedBlackTree_Node_Type.node_key node1, RedBlackTree_Node_Type.node_val node1); node1 <- (let RedBlackTree_Node_Type.C_Node a b c d e = node1 in RedBlackTree_Node_Type.C_Node a b (any k) d e); node1 <- (let RedBlackTree_Node_Type.C_Node a b c d e = node1 in RedBlackTree_Node_Type.C_Node a b c (any v) e); @@ -6718,11 +6718,11 @@ module RedBlackTree_Impl15_DeleteMinRec end } BB15 { - _33 <- ([#"../red_black_tree.rs" 702 35 702 67] Unwrap1.unwrap ([#"../red_black_tree.rs" 702 35 702 58] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_left ( * node))))); + _33 <- ([#"../red_black_tree.rs" 702 35 702 67] Unwrap2.unwrap ([#"../red_black_tree.rs" 702 35 702 58] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_left ( * node))))); goto BB16 } BB16 { - assume { Resolve1.resolve _33 }; + assume { Resolve5.resolve _33 }; goto BB17 } BB17 { @@ -6739,10 +6739,10 @@ module RedBlackTree_Impl15_DeleteMinRec BB19 { _36 <- borrow_mut ( * _37); _37 <- { _37 with current = ( ^ _36) }; - assume { Resolve2.resolve node }; + assume { Resolve1.resolve node }; node <- _36; _36 <- any borrowed (RedBlackTree_Node_Type.t_node k v); - assume { Resolve2.resolve _37 }; + assume { Resolve1.resolve _37 }; _25 <- (); goto BB21 } @@ -6765,7 +6765,7 @@ module RedBlackTree_Impl15_DeleteMinRec goto BB23 } BB23 { - assume { Resolve2.resolve node }; + assume { Resolve1.resolve node }; assume { Resolve3.resolve self }; _0 <- r; r <- any (k, v); @@ -6979,6 +6979,8 @@ module RedBlackTree_Impl15_DeleteMin type t = borrowed (RedBlackTree_Node_Type.t_node k v) clone Core_Option_Impl0_AsMut_Interface as AsMut0 with type t = RedBlackTree_Node_Type.t_node k v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = RedBlackTree_Tree_Type.t_tree k v clone RedBlackTree_Impl15_DeleteMinRec_Interface as DeleteMinRec0 with type k = k, type v = v, @@ -6992,16 +6994,14 @@ module RedBlackTree_Impl15_DeleteMin function LeLog0.le_log = LeLog0.le_log, predicate ColorInvariant0.color_invariant = ColorInvariant0.color_invariant, function Color0.color = Color0.color - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl13_IsRed_Interface as IsRed0 with type k = k, type v = v, function Color0.color = Color0.color - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = RedBlackTree_Tree_Type.t_tree k v - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = Ghost.ghost_ty () clone RedBlackTree_Impl0_HasMappingModel as HasMappingModel0 with @@ -7067,15 +7067,15 @@ module RedBlackTree_Impl15_DeleteMin } BB5 { node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a (RedBlackTree_Color_Type.C_Red) c d e) }; - assume { Resolve3.resolve node }; - assume { Resolve1.resolve _8 }; + assume { Resolve1.resolve node }; + assume { Resolve2.resolve _8 }; _7 <- (); goto BB7 } BB6 { - assume { Resolve3.resolve node }; + assume { Resolve1.resolve node }; _7 <- (); - assume { Resolve1.resolve _8 }; + assume { Resolve2.resolve _8 }; goto BB7 } BB7 { @@ -7086,9 +7086,9 @@ module RedBlackTree_Impl15_DeleteMin goto BB9 } BB8 { - assume { Resolve1.resolve _8 }; + assume { Resolve2.resolve _8 }; _0 <- Core_Option_Option_Type.C_None; - assume { Resolve2.resolve self }; + assume { Resolve3.resolve self }; goto BB18 } BB9 { @@ -7112,13 +7112,13 @@ module RedBlackTree_Impl15_DeleteMin } BB13 { _22 <- { _22 with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * _22 in RedBlackTree_Node_Type.C_Node a (RedBlackTree_Color_Type.C_Black) c d e) }; - assume { Resolve3.resolve _22 }; - assume { Resolve2.resolve self }; + assume { Resolve1.resolve _22 }; + assume { Resolve3.resolve self }; _18 <- (); goto BB15 } BB14 { - assume { Resolve2.resolve self }; + assume { Resolve3.resolve self }; _18 <- (); goto BB15 } @@ -7361,6 +7361,21 @@ module RedBlackTree_Impl15_DeleteRec type k = k, type v = v, function Color0.color = Color0.color + clone RedBlackTree_Impl1_HasMapping as HasMapping1 with + type k = k, + type v = v, + predicate HasMapping0.has_mapping = HasMapping0.has_mapping, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, + function DeepModel0.deep_model = DeepModel1.deep_model, + axiom . + clone RedBlackTree_Impl1_SameMappings as SameMappings0 with + type k = k, + type v = v, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, + predicate HasMapping0.has_mapping = HasMapping1.has_mapping, + predicate HasMapping1.has_mapping = HasMapping0.has_mapping + clone CreusotContracts_Std1_Option_Impl1_IsDefault as IsDefault0 with + type t = RedBlackTree_Node_Type.t_node k v use prelude.Ghost clone RedBlackTree_Impl3_ShallowModel as ShallowModel0 with type k = k, @@ -7387,12 +7402,10 @@ module RedBlackTree_Impl15_DeleteRec type v = v, predicate ColorInvariantHere0.color_invariant_here = ColorInvariantHere0.color_invariant_here, predicate ColorInvariant0.color_invariant = ColorInvariant0.color_invariant - clone RedBlackTree_Impl1_HasMapping as HasMapping1 with + clone RedBlackTree_Impl10_Height as Height1 with type k = k, type v = v, - predicate HasMapping0.has_mapping = HasMapping0.has_mapping, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, - function DeepModel0.deep_model = DeepModel1.deep_model, + function Height0.height = Height0.height, axiom . use RedBlackTree_Cp_Type as RedBlackTree_Cp_Type clone RedBlackTree_Impl6_MatchT as MatchT0 with @@ -7405,19 +7418,6 @@ module RedBlackTree_Impl15_DeleteRec type v = v, predicate ColorInvariant0.color_invariant = ColorInvariant1.color_invariant, predicate MatchT0.match_t = MatchT0.match_t - clone CreusotContracts_Std1_Option_Impl1_IsDefault as IsDefault0 with - type t = RedBlackTree_Node_Type.t_node k v - clone RedBlackTree_Impl10_Height as Height1 with - type k = k, - type v = v, - function Height0.height = Height0.height, - axiom . - clone RedBlackTree_Impl1_SameMappings as SameMappings0 with - type k = k, - type v = v, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, - predicate HasMapping0.has_mapping = HasMapping1.has_mapping, - predicate HasMapping1.has_mapping = HasMapping0.has_mapping clone RedBlackTree_Impl12_InternalInvariant as InternalInvariant1 with type k = k, type v = v, @@ -7445,30 +7445,35 @@ module RedBlackTree_Impl15_DeleteRec function Cpn0.cpn = Cpn0.cpn, predicate MatchN0.match_n = MatchN0.match_n, function Height1.height = Height0.height - clone RedBlackTree_Impl14_MoveRedLeft_Interface as MoveRedLeft0 with + clone RedBlackTree_Impl14_RotateRight_Interface as RotateRight0 with type k = k, type v = v, predicate InternalInvariant0.internal_invariant = InternalInvariant1.internal_invariant, - function Cpn0.cpn = Cpn0.cpn, - predicate MatchN0.match_n = MatchN0.match_n, + function Color0.color = Color0.color, + predicate SameMappings0.same_mappings = SameMappings0.same_mappings, function Height0.height = Height1.height, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, - predicate HasMapping0.has_mapping = HasMapping1.has_mapping, function DeepModel0.deep_model = DeepModel1.deep_model, - function LeLog0.le_log = LeLog0.le_log, - predicate ColorInvariant0.color_invariant = ColorInvariant1.color_invariant, - function Color0.color = Color0.color, + function LtLog0.lt_log = LtLog0.lt_log, function Height1.height = Height0.height, - predicate HasMapping1.has_mapping = HasMapping0.has_mapping - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve9 with + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve9 with + type self = RedBlackTree_Node_Type.t_node k v + clone Core_Option_Impl0_Unwrap_Interface as Unwrap2 with + type t = RedBlackTree_Node_Type.t_node k v + clone Core_Mem_Take_Interface as Take0 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v), + predicate IsDefault0.is_default = IsDefault0.is_default + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve8 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve7 with type t = v clone Core_Mem_Swap_Interface as Swap1 with type t = v - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve8 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve6 with type t = k clone Core_Mem_Swap_Interface as Swap0 with type t = k - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve7 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with type self = Ghost.ghost_ty () clone RedBlackTree_Impl0_HasMappingInj as HasMappingInj0 with type k = k, @@ -7507,42 +7512,37 @@ module RedBlackTree_Impl15_DeleteRec function Color0.color = Color0.color, function Height1.height = Height0.height, predicate HasMapping1.has_mapping = HasMapping0.has_mapping - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve6 with - type self = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_Unwrap_Interface as Unwrap2 with - type t = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_AsRef_Interface as AsRef0 with - type t = RedBlackTree_Node_Type.t_node k v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve5 with - type self = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_Unwrap_Interface as Unwrap1 with - type t = RedBlackTree_Node_Type.t_node k v - clone Core_Mem_Take_Interface as Take0 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v), - predicate IsDefault0.is_default = IsDefault0.is_default clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with type t = RedBlackTree_Tree_Type.t_tree k v clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = RedBlackTree_Node_Type.t_node k v - clone Core_Option_Impl0_IsNone_Interface as IsNone0 with type t = RedBlackTree_Node_Type.t_node k v - clone RedBlackTree_Impl14_RotateRight_Interface as RotateRight0 with + clone RedBlackTree_Impl14_MoveRedLeft_Interface as MoveRedLeft0 with type k = k, type v = v, predicate InternalInvariant0.internal_invariant = InternalInvariant1.internal_invariant, - function Color0.color = Color0.color, - predicate SameMappings0.same_mappings = SameMappings0.same_mappings, + function Cpn0.cpn = Cpn0.cpn, + predicate MatchN0.match_n = MatchN0.match_n, function Height0.height = Height1.height, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, + predicate HasMapping0.has_mapping = HasMapping1.has_mapping, function DeepModel0.deep_model = DeepModel1.deep_model, - function LtLog0.lt_log = LtLog0.lt_log, + function LeLog0.le_log = LeLog0.le_log, + predicate ColorInvariant0.color_invariant = ColorInvariant1.color_invariant, + function Color0.color = Color0.color, function Height1.height = Height0.height, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy + predicate HasMapping1.has_mapping = HasMapping0.has_mapping + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + type self = RedBlackTree_Node_Type.t_node k v + clone Core_Option_Impl0_Unwrap_Interface as Unwrap1 with + type t = RedBlackTree_Node_Type.t_node k v + clone Core_Option_Impl0_AsRef_Interface as AsRef0 with + type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl13_IsRed_Interface as IsRed0 with type k = k, type v = v, function Color0.color = Color0.color + clone Core_Option_Impl0_IsNone_Interface as IsNone0 with + type t = RedBlackTree_Node_Type.t_node k v clone Core_Cmp_Ord_Cmp_Interface as Cmp0 with type self = k, function DeepModel0.deep_model = DeepModel1.deep_model, @@ -7669,7 +7669,7 @@ module RedBlackTree_Impl15_DeleteRec end } BB9 { - assume { Resolve2.resolve node }; + assume { Resolve3.resolve node }; assume { Resolve1.resolve key }; _0 <- Core_Option_Option_Type.C_None; assume { Resolve4.resolve self }; @@ -7698,11 +7698,11 @@ module RedBlackTree_Impl15_DeleteRec end } BB15 { - _35 <- ([#"../red_black_tree.rs" 756 43 756 75] Unwrap2.unwrap ([#"../red_black_tree.rs" 756 43 756 66] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_left ( * node))))); + _35 <- ([#"../red_black_tree.rs" 756 43 756 75] Unwrap1.unwrap ([#"../red_black_tree.rs" 756 43 756 66] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_left ( * node))))); goto BB16 } BB16 { - assume { Resolve6.resolve _35 }; + assume { Resolve2.resolve _35 }; goto BB17 } BB17 { @@ -7719,10 +7719,10 @@ module RedBlackTree_Impl15_DeleteRec BB19 { _38 <- borrow_mut ( * _39); _39 <- { _39 with current = ( ^ _38) }; - assume { Resolve2.resolve node }; + assume { Resolve3.resolve node }; node <- _38; _38 <- any borrowed (RedBlackTree_Node_Type.t_node k v); - assume { Resolve2.resolve _39 }; + assume { Resolve3.resolve _39 }; _27 <- (); goto BB21 } @@ -7789,7 +7789,7 @@ module RedBlackTree_Impl15_DeleteRec end } BB35 { - assume { Resolve2.resolve node }; + assume { Resolve3.resolve node }; assume { Resolve1.resolve key }; switch (ord) | Core_Cmp_Ordering_Type.C_Greater -> goto BB36 @@ -7812,14 +7812,14 @@ module RedBlackTree_Impl15_DeleteRec goto BB39 } BB39 { - assume { Resolve3.resolve _62 }; + assume { Resolve8.resolve _62 }; assume { Resolve4.resolve self }; - node1 <- ([#"../red_black_tree.rs" 770 35 770 74] Unwrap1.unwrap ([#"../red_black_tree.rs" 770 35 770 65] Take0.take _61)); + node1 <- ([#"../red_black_tree.rs" 770 35 770 74] Unwrap2.unwrap ([#"../red_black_tree.rs" 770 35 770 65] Take0.take _61)); _61 <- any borrowed (Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v)); goto BB40 } BB40 { - assume { Resolve5.resolve node1 }; + assume { Resolve9.resolve node1 }; goto BB41 } BB41 { @@ -7838,11 +7838,11 @@ module RedBlackTree_Impl15_DeleteRec goto BB45 } BB45 { - _70 <- ([#"../red_black_tree.rs" 773 24 773 57] Unwrap2.unwrap ([#"../red_black_tree.rs" 773 24 773 48] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_right ( * node))))); + _70 <- ([#"../red_black_tree.rs" 773 24 773 57] Unwrap1.unwrap ([#"../red_black_tree.rs" 773 24 773 48] AsRef0.as_ref (RedBlackTree_Tree_Type.tree_node (RedBlackTree_Node_Type.node_right ( * node))))); goto BB46 } BB46 { - assume { Resolve6.resolve _70 }; + assume { Resolve2.resolve _70 }; goto BB47 } BB47 { @@ -7861,10 +7861,10 @@ module RedBlackTree_Impl15_DeleteRec BB49 { _73 <- borrow_mut ( * _74); _74 <- { _74 with current = ( ^ _73) }; - assume { Resolve2.resolve node }; + assume { Resolve3.resolve node }; node <- _73; _73 <- any borrowed (RedBlackTree_Node_Type.t_node k v); - assume { Resolve2.resolve _74 }; + assume { Resolve3.resolve _74 }; _66 <- (); goto BB51 } @@ -7894,7 +7894,7 @@ module RedBlackTree_Impl15_DeleteRec goto BB55 } BB55 { - assume { Resolve7.resolve _79 }; + assume { Resolve5.resolve _79 }; _83 <- borrow_mut (RedBlackTree_Node_Type.node_key ( * node)); node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a b ( ^ _83) d e) }; _82 <- borrow_mut ( * _83); @@ -7909,8 +7909,8 @@ module RedBlackTree_Impl15_DeleteRec goto BB56 } BB56 { - assume { Resolve8.resolve _85 }; - assume { Resolve8.resolve _83 }; + assume { Resolve6.resolve _85 }; + assume { Resolve6.resolve _83 }; _88 <- borrow_mut (RedBlackTree_Node_Type.node_val ( * node)); node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a b c ( ^ _88) e) }; _87 <- borrow_mut ( * _88); @@ -7925,8 +7925,8 @@ module RedBlackTree_Impl15_DeleteRec goto BB57 } BB57 { - assume { Resolve9.resolve _90 }; - assume { Resolve9.resolve _88 }; + assume { Resolve7.resolve _90 }; + assume { Resolve7.resolve _88 }; goto BB58 } BB58 { @@ -7973,7 +7973,7 @@ module RedBlackTree_Impl15_DeleteRec goto BB70 } BB70 { - assume { Resolve2.resolve node }; + assume { Resolve3.resolve node }; assume { Resolve4.resolve self }; _0 <- r; r <- any Core_Option_Option_Type.t_option (k, v); @@ -8200,6 +8200,8 @@ module RedBlackTree_Impl15_Delete type t = borrowed (RedBlackTree_Node_Type.t_node k v) clone Core_Option_Impl0_AsMut_Interface as AsMut0 with type t = RedBlackTree_Node_Type.t_node k v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with + type t = RedBlackTree_Tree_Type.t_tree k v clone RedBlackTree_Impl15_DeleteRec_Interface as DeleteRec0 with type k = k, type v = v, @@ -8213,18 +8215,16 @@ module RedBlackTree_Impl15_Delete type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, predicate ColorInvariant0.color_invariant = ColorInvariant0.color_invariant, function Color0.color = Color0.color - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + type self = k + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = RedBlackTree_Node_Type.t_node k v clone RedBlackTree_Impl13_IsRed_Interface as IsRed0 with type k = k, type v = v, function Color0.color = Color0.color - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with - type t = RedBlackTree_Tree_Type.t_tree k v - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with - type self = k - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = Ghost.ghost_ty () clone RedBlackTree_Impl0_HasMappingModel as HasMappingModel0 with @@ -8292,30 +8292,30 @@ module RedBlackTree_Impl15_Delete } BB5 { node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a (RedBlackTree_Color_Type.C_Red) c d e) }; - assume { Resolve4.resolve node }; - assume { Resolve1.resolve _10 }; + assume { Resolve1.resolve node }; + assume { Resolve2.resolve _10 }; _9 <- (); goto BB7 } BB6 { - assume { Resolve4.resolve node }; + assume { Resolve1.resolve node }; _9 <- (); - assume { Resolve1.resolve _10 }; + assume { Resolve2.resolve _10 }; goto BB7 } BB7 { _19 <- borrow_mut ( * self); self <- { self with current = ( ^ _19) }; - assume { Resolve2.resolve key }; + assume { Resolve3.resolve key }; r <- ([#"../red_black_tree.rs" 810 16 810 36] DeleteRec0.delete_rec _19 key); _19 <- any borrowed (RedBlackTree_Tree_Type.t_tree k v); goto BB9 } BB8 { - assume { Resolve1.resolve _10 }; - assume { Resolve2.resolve key }; + assume { Resolve2.resolve _10 }; + assume { Resolve3.resolve key }; _0 <- Core_Option_Option_Type.C_None; - assume { Resolve3.resolve self }; + assume { Resolve4.resolve self }; goto BB17 } BB9 { @@ -8339,13 +8339,13 @@ module RedBlackTree_Impl15_Delete } BB13 { _25 <- { _25 with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * _25 in RedBlackTree_Node_Type.C_Node a (RedBlackTree_Color_Type.C_Black) c d e) }; - assume { Resolve4.resolve _25 }; - assume { Resolve3.resolve self }; + assume { Resolve1.resolve _25 }; + assume { Resolve4.resolve self }; _21 <- (); goto BB15 } BB14 { - assume { Resolve3.resolve self }; + assume { Resolve4.resolve self }; _21 <- (); goto BB15 } @@ -8897,20 +8897,20 @@ module RedBlackTree_Impl15_GetMut predicate ColorInvariant0.color_invariant = ColorInvariant0.color_invariant, function Color0.color = Color0.color clone CreusotContracts_Resolve_Impl1_Resolve as Resolve6 with - type t = v + type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) clone CreusotContracts_Resolve_Impl1_Resolve as Resolve5 with - type t = RedBlackTree_Tree_Type.t_tree k v - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with type t = RedBlackTree_Node_Type.t_node k v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with + type t = v + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = RedBlackTree_Tree_Type.t_tree k v clone Core_Cmp_Ord_Cmp_Interface as Cmp0 with type self = k, function DeepModel0.deep_model = DeepModel1.deep_model, function CmpLog0.cmp_log = CmpLog0.cmp_log, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = k - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = Core_Option_Option_Type.t_option (RedBlackTree_Node_Type.t_node k v) use RedBlackTree_Cp_Type as RedBlackTree_Cp_Type clone RedBlackTree_Impl6_MatchT as MatchT0 with type k = k, @@ -9006,7 +9006,7 @@ module RedBlackTree_Impl15_GetMut node <- borrow_mut (Core_Option_Option_Type.some_0 ( * _23)); _23 <- { _23 with current = (let Core_Option_Option_Type.C_Some a = * _23 in Core_Option_Option_Type.C_Some ( ^ node)) }; _29 <- RedBlackTree_Node_Type.node_key ( * node); - assume { Resolve3.resolve _29 }; + assume { Resolve2.resolve _29 }; goto BB7 } BB7 { @@ -9027,18 +9027,18 @@ module RedBlackTree_Impl15_GetMut node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a b c d ( ^ _37)) }; _36 <- borrow_mut ( * _37); _37 <- { _37 with current = ( ^ _36) }; - assume { Resolve5.resolve tree }; + assume { Resolve3.resolve tree }; tree <- _36; _36 <- any borrowed (RedBlackTree_Tree_Type.t_tree k v); _22 <- (); - assume { Resolve5.resolve _37 }; + assume { Resolve3.resolve _37 }; goto BB14 } BB11 { - assume { Resolve4.resolve node }; - assume { Resolve3.resolve key }; - assume { Resolve2.resolve _23 }; - assume { Resolve5.resolve tree }; + assume { Resolve5.resolve node }; + assume { Resolve2.resolve key }; + assume { Resolve6.resolve _23 }; + assume { Resolve3.resolve tree }; absurd } BB12 { @@ -9046,39 +9046,39 @@ module RedBlackTree_Impl15_GetMut node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node ( ^ _32) b c d e) }; _31 <- borrow_mut ( * _32); _32 <- { _32 with current = ( ^ _31) }; - assume { Resolve5.resolve tree }; + assume { Resolve3.resolve tree }; tree <- _31; _31 <- any borrowed (RedBlackTree_Tree_Type.t_tree k v); _22 <- (); - assume { Resolve5.resolve _32 }; + assume { Resolve3.resolve _32 }; goto BB14 } BB13 { - assume { Resolve3.resolve key }; + assume { Resolve2.resolve key }; _35 <- borrow_mut (RedBlackTree_Node_Type.node_val ( * node)); node <- { node with current = (let RedBlackTree_Node_Type.C_Node a b c d e = * node in RedBlackTree_Node_Type.C_Node a b c ( ^ _35) e) }; _34 <- borrow_mut ( * _35); _35 <- { _35 with current = ( ^ _34) }; _0 <- Core_Option_Option_Type.C_Some _34; _34 <- any borrowed v; - assume { Resolve6.resolve _35 }; - assume { Resolve4.resolve node }; - assume { Resolve2.resolve _23 }; + assume { Resolve4.resolve _35 }; + assume { Resolve5.resolve node }; + assume { Resolve6.resolve _23 }; goto BB16 } BB14 { - assume { Resolve4.resolve node }; - assume { Resolve2.resolve _23 }; + assume { Resolve5.resolve node }; + assume { Resolve6.resolve _23 }; goto BB3 } BB15 { - assume { Resolve2.resolve _23 }; - assume { Resolve3.resolve key }; + assume { Resolve6.resolve _23 }; + assume { Resolve2.resolve key }; _0 <- Core_Option_Option_Type.C_None; goto BB16 } BB16 { - assume { Resolve5.resolve tree }; + assume { Resolve3.resolve tree }; return _0 } diff --git a/creusot/tests/should_succeed/red_black_tree/why3session.xml b/creusot/tests/should_succeed/red_black_tree/why3session.xml index d8fab6b4ef..2920276566 100644 --- a/creusot/tests/should_succeed/red_black_tree/why3session.xml +++ b/creusot/tests/should_succeed/red_black_tree/why3session.xml @@ -3,9 +3,11 @@ "http://why3.lri.fr/why3session.dtd"> + + @@ -147,13 +149,13 @@ - + - + @@ -162,7 +164,7 @@ - + @@ -171,7 +173,7 @@ - + @@ -183,12 +185,12 @@ - + - + @@ -243,7 +245,7 @@ - + @@ -252,27 +254,27 @@ - + - + - + - + - + @@ -314,12 +316,12 @@ - + - + @@ -346,7 +348,7 @@ - + @@ -400,7 +402,7 @@ - + @@ -419,7 +421,7 @@ - + @@ -428,14 +430,14 @@ - + - + @@ -456,7 +458,7 @@ - + @@ -494,7 +496,7 @@ - + @@ -520,17 +522,17 @@ - + - + - + @@ -584,7 +586,7 @@ - + @@ -599,13 +601,13 @@ - + - + - + @@ -624,7 +626,7 @@ - + @@ -688,7 +690,7 @@ - + @@ -700,7 +702,7 @@ - + @@ -738,20 +740,20 @@ - + - + - + - + @@ -767,7 +769,7 @@ - + @@ -787,7 +789,7 @@ - + @@ -798,20 +800,20 @@ - + - + - + - + @@ -822,7 +824,7 @@ - + @@ -1631,47 +1633,47 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -1696,10 +1698,10 @@ - + - + @@ -1711,16 +1713,16 @@ - + - + - + @@ -1780,15 +1782,15 @@ - + - + - + @@ -1803,14 +1805,14 @@ - + - + @@ -1818,7 +1820,7 @@ - + @@ -1837,7 +1839,7 @@ - + @@ -1846,20 +1848,20 @@ - + - + - + - + @@ -1867,7 +1869,7 @@ - + @@ -1877,14 +1879,14 @@ - + - + @@ -1897,7 +1899,7 @@ - + @@ -1910,15 +1912,15 @@ - + - + - + @@ -1932,17 +1934,17 @@ - + - + - + @@ -1972,7 +1974,7 @@ - + @@ -1989,7 +1991,7 @@ - + @@ -2008,7 +2010,7 @@ - + @@ -2027,7 +2029,7 @@ - + @@ -2059,7 +2061,7 @@ - + @@ -2072,10 +2074,10 @@ - + - + @@ -2085,7 +2087,7 @@ - + @@ -2104,7 +2106,7 @@ - + @@ -2133,10 +2135,10 @@ - + - + @@ -2146,7 +2148,7 @@ - + @@ -2162,7 +2164,7 @@ - + @@ -2171,10 +2173,10 @@ - + - + @@ -2189,7 +2191,7 @@ - + @@ -2204,22 +2206,22 @@ - + - + - + - + @@ -2228,15 +2230,15 @@ - + - + - + @@ -2252,27 +2254,27 @@ - + - + - + - + - + - + @@ -2281,7 +2283,7 @@ - + @@ -2292,12 +2294,12 @@ - + - + @@ -2324,13 +2326,13 @@ - + - + - + @@ -2378,17 +2380,17 @@ - + - + - + @@ -2399,22 +2401,22 @@ - + - + - + - + - + @@ -2451,36 +2453,36 @@ - + - + - + - + - + - + @@ -2490,7 +2492,7 @@ - + @@ -2514,7 +2516,7 @@ - + @@ -2524,7 +2526,7 @@ - + @@ -2546,10 +2548,10 @@ - + - + @@ -2562,7 +2564,7 @@ - + @@ -2571,7 +2573,7 @@ - + @@ -2579,7 +2581,7 @@ - + @@ -2590,10 +2592,10 @@ - + - + @@ -2602,27 +2604,27 @@ - + - + - + - + - + - + @@ -2631,7 +2633,7 @@ - + @@ -2646,14 +2648,14 @@ - + - + @@ -2668,7 +2670,7 @@ - + @@ -2680,7 +2682,7 @@ - + @@ -2691,132 +2693,84 @@ - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - + @@ -2825,94 +2779,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2921,58 +2791,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2981,10 +2800,10 @@ - + - + @@ -2993,124 +2812,57 @@ - + - + - + - + - - - - - + - + - - - - - - - - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - + @@ -3119,21 +2871,21 @@ - + - + - + - + - + @@ -3144,65 +2896,32 @@ - + - + - - - - - + - + - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + @@ -3211,49 +2930,45 @@ - + - + - + - + - + - + - + - - - - - + - + @@ -3266,59 +2981,29 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - + @@ -3327,10 +3012,10 @@ - + - + @@ -3341,36 +3026,29 @@ - + - + - + - + - - - - - - - - + @@ -3379,10 +3057,10 @@ - + - + @@ -3393,41 +3071,29 @@ - - - - - - - - - + - - - - - + - + - + - + @@ -3436,14 +3102,10 @@ - + - - - - - + @@ -3456,57 +3118,28 @@ - + - + - + - - - - - - - - - - - - + - - - - - - - - - - - - + - - - - - - - - + @@ -3515,28 +3148,21 @@ - + - + - + - + - - - - - - - - + @@ -3552,38 +3178,38 @@ - + - + - + - + - + - + - + @@ -3609,7 +3235,7 @@ - + @@ -3621,51 +3247,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -3676,7 +3302,7 @@ - + @@ -3685,15 +3311,15 @@ - + - + - + diff --git a/creusot/tests/should_succeed/red_black_tree/why3shapes.gz b/creusot/tests/should_succeed/red_black_tree/why3shapes.gz index 3c4f9108e0..3bc253957a 100644 Binary files a/creusot/tests/should_succeed/red_black_tree/why3shapes.gz and b/creusot/tests/should_succeed/red_black_tree/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/result/own.mlcfg b/creusot/tests/should_succeed/result/own.mlcfg index eb849f854d..978941def1 100644 --- a/creusot/tests/should_succeed/result/own.mlcfg +++ b/creusot/tests/should_succeed/result/own.mlcfg @@ -4,16 +4,16 @@ module Own_OwnResult_Type | C_Ok 't | C_Err 'e - let function err_0 (self : t_ownresult 't 'e) : 'e = [@vc:do_not_keep_trace] [@vc:sp] - match (self) with - | C_Ok _ -> any 'e - | C_Err a -> a - end let function ok_0 (self : t_ownresult 't 'e) : 't = [@vc:do_not_keep_trace] [@vc:sp] match (self) with | C_Ok a -> a | C_Err _ -> any 't end + let function err_0 (self : t_ownresult 't 'e) : 'e = [@vc:do_not_keep_trace] [@vc:sp] + match (self) with + | C_Ok _ -> any 'e + | C_Err a -> a + end end module CreusotContracts_Resolve_Resolve_Resolve_Stub type self @@ -177,9 +177,9 @@ module Own_Impl0_Ok type e clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = t - use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = e + use Core_Option_Option_Type as Core_Option_Option_Type use Own_OwnResult_Type as Own_OwnResult_Type clone Own_Impl4_Resolve as Resolve0 with type t = t, @@ -265,14 +265,14 @@ module Own_Impl0_Err type e clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = e - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with - type self = t use Core_Option_Option_Type as Core_Option_Option_Type + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with + type self = t use Own_OwnResult_Type as Own_OwnResult_Type - clone Own_Impl4_Resolve as Resolve0 with + clone Own_Impl4_Resolve as Resolve1 with type t = t, type e = e, - predicate Resolve0.resolve = Resolve1.resolve, + predicate Resolve0.resolve = Resolve0.resolve, predicate Resolve1.resolve = Resolve2.resolve let rec cfg err [#"../own.rs" 46 4 46 33] [@cfg:stackify] [@cfg:subregion_analysis] (self : Own_OwnResult_Type.t_ownresult t e) : Core_Option_Option_Type.t_option e ensures { [#"../own.rs" 44 4 44 74] (exists t : t . self = Own_OwnResult_Type.C_Ok t) -> result = Core_Option_Option_Type.C_None } @@ -304,20 +304,20 @@ module Own_Impl0_Err BB4 { x1 <- Own_OwnResult_Type.err_0 self; self <- (let Own_OwnResult_Type.C_Err a = self in Own_OwnResult_Type.C_Err (any e)); - assume { Resolve0.resolve self }; + assume { Resolve1.resolve self }; _0 <- Core_Option_Option_Type.C_Some x1; x1 <- any e; goto BB8 } BB5 { - assume { Resolve0.resolve self }; + assume { Resolve1.resolve self }; absurd } BB6 { x <- Own_OwnResult_Type.ok_0 self; self <- (let Own_OwnResult_Type.C_Ok a = self in Own_OwnResult_Type.C_Ok (any t)); - assume { Resolve1.resolve x }; - assume { Resolve0.resolve self }; + assume { Resolve0.resolve x }; + assume { Resolve1.resolve self }; _0 <- Core_Option_Option_Type.C_None; goto BB7 } @@ -353,10 +353,10 @@ module Own_Impl0_AsRef type e use prelude.Borrow clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with - type self = t + type self = e use Own_OwnResult_Type as Own_OwnResult_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with - type self = e + type self = t clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = Own_OwnResult_Type.t_ownresult t e let rec cfg as_ref [#"../own.rs" 56 4 56 45] [@cfg:stackify] [@cfg:subregion_analysis] (self : Own_OwnResult_Type.t_ownresult t e) : Own_OwnResult_Type.t_ownresult t e @@ -383,7 +383,7 @@ module Own_Impl0_AsRef BB2 { x1 <- Own_OwnResult_Type.err_0 self; assume { Resolve0.resolve self }; - assume { Resolve1.resolve x1 }; + assume { Resolve2.resolve x1 }; _0 <- Own_OwnResult_Type.C_Err x1; goto BB5 } @@ -394,7 +394,7 @@ module Own_Impl0_AsRef BB4 { x <- Own_OwnResult_Type.ok_0 self; assume { Resolve0.resolve self }; - assume { Resolve2.resolve x }; + assume { Resolve1.resolve x }; _0 <- Own_OwnResult_Type.C_Ok x; goto BB5 } @@ -438,13 +438,13 @@ module Own_Impl0_AsMut type t type e use prelude.Borrow + use Own_OwnResult_Type as Own_OwnResult_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = t + type t = Own_OwnResult_Type.t_ownresult t e clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = e - use Own_OwnResult_Type as Own_OwnResult_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with - type t = Own_OwnResult_Type.t_ownresult t e + type t = t let rec cfg as_mut [#"../own.rs" 71 4 71 57] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (Own_OwnResult_Type.t_ownresult t e)) : Own_OwnResult_Type.t_ownresult (borrowed t) (borrowed e) ensures { [#"../own.rs" 63 4 70 6] exists t : borrowed t . * self = Own_OwnResult_Type.C_Ok ( * t) /\ ^ self = Own_OwnResult_Type.C_Ok ( ^ t) /\ result = Own_OwnResult_Type.C_Ok t \/ (exists e : borrowed e . * self = Own_OwnResult_Type.C_Err ( * e) /\ ^ self = Own_OwnResult_Type.C_Err ( ^ e) /\ result = Own_OwnResult_Type.C_Err e) } @@ -478,7 +478,7 @@ module Own_Impl0_AsMut goto BB5 } BB3 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; absurd } BB4 { @@ -488,11 +488,11 @@ module Own_Impl0_AsMut x <- { x with current = ( ^ _5) }; _0 <- Own_OwnResult_Type.C_Ok _5; _5 <- any borrowed t; - assume { Resolve2.resolve x }; + assume { Resolve0.resolve x }; goto BB5 } BB5 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; return _0 } @@ -665,13 +665,13 @@ module Own_Impl0_UnwrapErr type e clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = e - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = t use Own_OwnResult_Type as Own_OwnResult_Type - clone Own_Impl4_Resolve as Resolve0 with + clone Own_Impl4_Resolve as Resolve1 with type t = t, type e = e, - predicate Resolve0.resolve = Resolve1.resolve, + predicate Resolve0.resolve = Resolve0.resolve, predicate Resolve1.resolve = Resolve2.resolve let rec cfg unwrap_err [#"../own.rs" 104 4 106 29] [@cfg:stackify] [@cfg:subregion_analysis] (self : Own_OwnResult_Type.t_ownresult t e) : e requires {[#"../own.rs" 102 4 102 55] exists e : e . self = Own_OwnResult_Type.C_Err e} @@ -703,20 +703,20 @@ module Own_Impl0_UnwrapErr BB4 { e <- Own_OwnResult_Type.err_0 self; self <- (let Own_OwnResult_Type.C_Err a = self in Own_OwnResult_Type.C_Err (any e)); - assume { Resolve0.resolve self }; + assume { Resolve1.resolve self }; _0 <- e; e <- any e; goto BB7 } BB5 { - assume { Resolve0.resolve self }; + assume { Resolve1.resolve self }; absurd } BB6 { _t <- Own_OwnResult_Type.ok_0 self; self <- (let Own_OwnResult_Type.C_Ok a = self in Own_OwnResult_Type.C_Ok (any t)); - assume { Resolve1.resolve _t }; - assume { Resolve0.resolve self }; + assume { Resolve0.resolve _t }; + assume { Resolve1.resolve self }; absurd } BB7 { @@ -941,22 +941,22 @@ module Own_Impl0_And type e type u clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with - type self = e - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with type self = u - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with - type self = t + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + type self = e use Own_OwnResult_Type as Own_OwnResult_Type + clone Own_Impl4_Resolve as Resolve2 with + type t = u, + type e = e, + predicate Resolve0.resolve = Resolve4.resolve, + predicate Resolve1.resolve = Resolve3.resolve + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with + type self = t clone Own_Impl4_Resolve as Resolve1 with type t = t, type e = e, - predicate Resolve0.resolve = Resolve2.resolve, - predicate Resolve1.resolve = Resolve4.resolve - clone Own_Impl4_Resolve as Resolve0 with - type t = u, - type e = e, - predicate Resolve0.resolve = Resolve3.resolve, - predicate Resolve1.resolve = Resolve4.resolve + predicate Resolve0.resolve = Resolve0.resolve, + predicate Resolve1.resolve = Resolve3.resolve let rec cfg and [#"../own.rs" 138 4 138 64] [@cfg:stackify] [@cfg:subregion_analysis] (self : Own_OwnResult_Type.t_ownresult t e) (res : Own_OwnResult_Type.t_ownresult u e) : Own_OwnResult_Type.t_ownresult u e ensures { [#"../own.rs" 136 4 136 73] (exists t : t . self = Own_OwnResult_Type.C_Ok t) -> result = res } ensures { [#"../own.rs" 137 4 137 86] forall e : e . self = Own_OwnResult_Type.C_Err e -> result = Own_OwnResult_Type.C_Err e } @@ -986,7 +986,7 @@ module Own_Impl0_And goto BB6 } BB4 { - assume { Resolve0.resolve res }; + assume { Resolve2.resolve res }; e <- Own_OwnResult_Type.err_0 self; self <- (let Own_OwnResult_Type.C_Err a = self in Own_OwnResult_Type.C_Err (any e)); assume { Resolve1.resolve self }; @@ -995,14 +995,14 @@ module Own_Impl0_And goto BB8 } BB5 { - assume { Resolve0.resolve res }; + assume { Resolve2.resolve res }; assume { Resolve1.resolve self }; absurd } BB6 { x <- Own_OwnResult_Type.ok_0 self; self <- (let Own_OwnResult_Type.C_Ok a = self in Own_OwnResult_Type.C_Ok (any t)); - assume { Resolve2.resolve x }; + assume { Resolve0.resolve x }; assume { Resolve1.resolve self }; _0 <- res; res <- any Own_OwnResult_Type.t_ownresult u e; @@ -1046,9 +1046,9 @@ module Own_Impl0_Or type self = f clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with type self = t - use Own_OwnResult_Type as Own_OwnResult_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = e + use Own_OwnResult_Type as Own_OwnResult_Type clone Own_Impl4_Resolve as Resolve1 with type t = t, type e = e, @@ -1146,9 +1146,9 @@ module Own_Impl1_Copied use prelude.Borrow clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = e + use Own_OwnResult_Type as Own_OwnResult_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = t - use Own_OwnResult_Type as Own_OwnResult_Type clone Own_Impl4_Resolve as Resolve0 with type t = t, type e = e, @@ -1237,11 +1237,11 @@ module Own_Impl1_Cloned use prelude.Borrow clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = e + use Own_OwnResult_Type as Own_OwnResult_Type clone Core_Clone_Clone_Clone_Interface as Clone0 with type self = t clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = t - use Own_OwnResult_Type as Own_OwnResult_Type clone Own_Impl4_Resolve as Resolve0 with type t = t, type e = e, @@ -1331,9 +1331,9 @@ module Own_Impl2_Copied use prelude.Borrow clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = e + use Own_OwnResult_Type as Own_OwnResult_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = t - use Own_OwnResult_Type as Own_OwnResult_Type clone Own_Impl4_Resolve as Resolve0 with type t = borrowed t, type e = e, @@ -1418,11 +1418,11 @@ module Own_Impl2_Cloned use prelude.Borrow clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = e + use Own_OwnResult_Type as Own_OwnResult_Type clone Core_Clone_Clone_Clone_Interface as Clone0 with type self = t clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = t - use Own_OwnResult_Type as Own_OwnResult_Type clone Own_Impl4_Resolve as Resolve0 with type t = borrowed t, type e = e, diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_2_list.mlcfg b/creusot/tests/should_succeed/rusthorn/inc_some_2_list.mlcfg index c26c122178..f6099a300f 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_2_list.mlcfg +++ b/creusot/tests/should_succeed/rusthorn/inc_some_2_list.mlcfg @@ -290,13 +290,13 @@ module IncSome2List_Impl0_TakeSomeRest clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = IncSome2List_List_Type.t_list clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = IncSome2List_List_Type.t_list + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = uint32 clone IncSome2List_Random_Interface as Random0 clone IncSome2List_Impl0_LemmaSumNonneg as LemmaSumNonneg0 with function Sum0.sum = Sum0.sum, axiom . - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with - type t = IncSome2List_List_Type.t_list let rec cfg take_some_rest [#"../inc_some_2_list.rs" 54 4 54 57] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (IncSome2List_List_Type.t_list)) : (borrowed uint32, borrowed (IncSome2List_List_Type.t_list)) ensures { [#"../inc_some_2_list.rs" 50 14 51 72] Sum0.sum ( ^ self) - Sum0.sum ( * self) = UInt32.to_int ( ^ (let (a, _) = result in a)) + Sum0.sum ( ^ (let (_, a) = result in a)) - ShallowModel0.shallow_model (let (a, _) = result in a) - Sum0.sum ( * (let (_, a) = result in a)) } ensures { [#"../inc_some_2_list.rs" 52 14 52 37] ShallowModel0.shallow_model (let (a, _) = result in a) <= Sum0.sum ( * self) } @@ -324,11 +324,11 @@ module IncSome2List_Impl0_TakeSomeRest goto BB4 } BB2 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; goto BB11 } BB3 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; absurd } BB4 { @@ -359,7 +359,7 @@ module IncSome2List_Impl0_TakeSomeRest goto BB10 } BB8 { - assume { Resolve1.resolve ma }; + assume { Resolve0.resolve ma }; _13 <- borrow_mut ( * ml); ml <- { ml with current = ( ^ _13) }; _0 <- ([#"../inc_some_2_list.rs" 61 20 61 39] take_some_rest _13); @@ -370,9 +370,9 @@ module IncSome2List_Impl0_TakeSomeRest goto BB10 } BB10 { - assume { Resolve2.resolve ml }; - assume { Resolve1.resolve ma }; - assume { Resolve0.resolve self }; + assume { Resolve1.resolve ml }; + assume { Resolve0.resolve ma }; + assume { Resolve2.resolve self }; return _0 } BB11 { diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3session.xml b/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3session.xml index 197c92a6aa..c6c047ffe8 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3session.xml +++ b/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3session.xml @@ -18,7 +18,7 @@ - + diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3shapes.gz b/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3shapes.gz index be16bbddd7..9c16f09579 100644 Binary files a/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3shapes.gz and b/creusot/tests/should_succeed/rusthorn/inc_some_2_list/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_2_tree.mlcfg b/creusot/tests/should_succeed/rusthorn/inc_some_2_tree.mlcfg index eaedda6e13..296f6cb9f3 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_2_tree.mlcfg +++ b/creusot/tests/should_succeed/rusthorn/inc_some_2_tree.mlcfg @@ -301,15 +301,15 @@ module IncSome2Tree_Impl0_TakeSomeRest use IncSome2Tree_Tree_Type as IncSome2Tree_Tree_Type clone IncSome2Tree_Impl0_Sum as Sum0 clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = uint32 + type t = IncSome2Tree_Tree_Type.t_tree clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = IncSome2Tree_Tree_Type.t_tree + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = uint32 clone IncSome2Tree_Random_Interface as Random0 clone IncSome2Tree_Impl0_LemmaSumNonneg as LemmaSumNonneg0 with function Sum0.sum = Sum0.sum, axiom . - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with - type t = IncSome2Tree_Tree_Type.t_tree let rec cfg take_some_rest [#"../inc_some_2_tree.rs" 63 4 63 57] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (IncSome2Tree_Tree_Type.t_tree)) : (borrowed uint32, borrowed (IncSome2Tree_Tree_Type.t_tree)) ensures { [#"../inc_some_2_tree.rs" 59 14 60 72] Sum0.sum ( ^ self) - Sum0.sum ( * self) = UInt32.to_int ( ^ (let (a, _) = result in a)) + Sum0.sum ( ^ (let (_, a) = result in a)) - ShallowModel0.shallow_model (let (a, _) = result in a) - Sum0.sum ( * (let (_, a) = result in a)) } ensures { [#"../inc_some_2_tree.rs" 61 14 61 37] ShallowModel0.shallow_model (let (a, _) = result in a) <= Sum0.sum ( * self) } @@ -340,11 +340,11 @@ module IncSome2Tree_Impl0_TakeSomeRest goto BB4 } BB2 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; goto BB19 } BB3 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; absurd } BB4 { @@ -380,7 +380,7 @@ module IncSome2Tree_Impl0_TakeSomeRest mtl <- { mtl with current = ( ^ _16) }; _14 <- borrow_mut ( * _16); _16 <- { _16 with current = ( ^ _14) }; - assume { Resolve0.resolve _16 }; + assume { Resolve2.resolve _16 }; goto BB10 } BB9 { @@ -395,11 +395,11 @@ module IncSome2Tree_Impl0_TakeSomeRest _0 <- (_12, _13); _12 <- any borrowed uint32; _13 <- any borrowed (IncSome2Tree_Tree_Type.t_tree); - assume { Resolve0.resolve _14 }; + assume { Resolve2.resolve _14 }; goto BB18 } BB11 { - assume { Resolve2.resolve ma }; + assume { Resolve0.resolve ma }; goto BB12 } BB12 { @@ -435,9 +435,9 @@ module IncSome2Tree_Impl0_TakeSomeRest } BB18 { assume { Resolve1.resolve mtr }; - assume { Resolve2.resolve ma }; + assume { Resolve0.resolve ma }; assume { Resolve1.resolve mtl }; - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; return _0 } BB19 { diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3session.xml b/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3session.xml index a5a44f289a..46c3965a6b 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3session.xml +++ b/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3session.xml @@ -3,6 +3,7 @@ "http://why3.lri.fr/why3session.dtd"> + @@ -18,7 +19,7 @@ - + diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3shapes.gz b/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3shapes.gz index 5e3b181c01..cba7d44e27 100644 Binary files a/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3shapes.gz and b/creusot/tests/should_succeed/rusthorn/inc_some_2_tree/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_list.mlcfg b/creusot/tests/should_succeed/rusthorn/inc_some_list.mlcfg index 2945c87a91..c27dec60dc 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_list.mlcfg +++ b/creusot/tests/should_succeed/rusthorn/inc_some_list.mlcfg @@ -287,15 +287,15 @@ module IncSomeList_Impl0_TakeSome use IncSomeList_List_Type as IncSomeList_List_Type clone IncSomeList_Impl0_Sum as Sum0 clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = uint32 + type t = IncSomeList_List_Type.t_list clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = IncSomeList_List_Type.t_list + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = uint32 clone IncSomeList_Random_Interface as Random0 clone IncSomeList_Impl0_LemmaSumNonneg as LemmaSumNonneg0 with function Sum0.sum = Sum0.sum, axiom . - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with - type t = IncSomeList_List_Type.t_list let rec cfg take_some [#"../inc_some_list.rs" 51 4 51 39] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (IncSomeList_List_Type.t_list)) : borrowed uint32 ensures { [#"../inc_some_list.rs" 49 14 49 64] Sum0.sum ( ^ self) - Sum0.sum ( * self) = UInt32.to_int ( ^ result) - ShallowModel0.shallow_model result } ensures { [#"../inc_some_list.rs" 50 14 50 35] ShallowModel0.shallow_model result <= Sum0.sum ( * self) } @@ -326,11 +326,11 @@ module IncSomeList_Impl0_TakeSome goto BB4 } BB2 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; goto BB11 } BB3 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; absurd } BB4 { @@ -356,11 +356,11 @@ module IncSomeList_Impl0_TakeSome ma <- { ma with current = ( ^ _14) }; _12 <- borrow_mut ( * _14); _14 <- { _14 with current = ( ^ _12) }; - assume { Resolve2.resolve _14 }; + assume { Resolve0.resolve _14 }; goto BB10 } BB8 { - assume { Resolve2.resolve ma }; + assume { Resolve0.resolve ma }; _16 <- borrow_mut ( * ml); ml <- { ml with current = ( ^ _16) }; _15 <- ([#"../inc_some_list.rs" 58 20 58 34] take_some _16); @@ -370,7 +370,7 @@ module IncSomeList_Impl0_TakeSome BB9 { _12 <- borrow_mut ( * _15); _15 <- { _15 with current = ( ^ _12) }; - assume { Resolve2.resolve _15 }; + assume { Resolve0.resolve _15 }; goto BB10 } BB10 { @@ -378,17 +378,17 @@ module IncSomeList_Impl0_TakeSome _12 <- { _12 with current = ( ^ _9) }; _5 <- borrow_mut ( * _9); _9 <- { _9 with current = ( ^ _5) }; - assume { Resolve2.resolve _12 }; - assume { Resolve2.resolve _9 }; + assume { Resolve0.resolve _12 }; + assume { Resolve0.resolve _9 }; assume { Resolve1.resolve ml }; - assume { Resolve2.resolve ma }; + assume { Resolve0.resolve ma }; _2 <- borrow_mut ( * _5); _5 <- { _5 with current = ( ^ _2) }; _0 <- borrow_mut ( * _2); _2 <- { _2 with current = ( ^ _0) }; - assume { Resolve2.resolve _5 }; - assume { Resolve2.resolve _2 }; - assume { Resolve0.resolve self }; + assume { Resolve0.resolve _5 }; + assume { Resolve0.resolve _2 }; + assume { Resolve2.resolve self }; return _0 } BB11 { diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_list/why3session.xml b/creusot/tests/should_succeed/rusthorn/inc_some_list/why3session.xml index b82db7a5d7..a1c38c3894 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_list/why3session.xml +++ b/creusot/tests/should_succeed/rusthorn/inc_some_list/why3session.xml @@ -17,7 +17,7 @@ - + diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_list/why3shapes.gz b/creusot/tests/should_succeed/rusthorn/inc_some_list/why3shapes.gz index 5c6a91f99c..f163e440f0 100644 Binary files a/creusot/tests/should_succeed/rusthorn/inc_some_list/why3shapes.gz and b/creusot/tests/should_succeed/rusthorn/inc_some_list/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_tree.mlcfg b/creusot/tests/should_succeed/rusthorn/inc_some_tree.mlcfg index c88c59b782..96a692ff2f 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_tree.mlcfg +++ b/creusot/tests/should_succeed/rusthorn/inc_some_tree.mlcfg @@ -300,15 +300,15 @@ module IncSomeTree_Impl0_TakeSome use IncSomeTree_Tree_Type as IncSomeTree_Tree_Type clone IncSomeTree_Impl0_Sum as Sum0 clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = uint32 + type t = IncSomeTree_Tree_Type.t_tree clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = IncSomeTree_Tree_Type.t_tree + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with + type t = uint32 clone IncSomeTree_Random_Interface as Random0 clone IncSomeTree_Impl0_LemmaSumNonneg as LemmaSumNonneg0 with function Sum0.sum = Sum0.sum, axiom . - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with - type t = IncSomeTree_Tree_Type.t_tree let rec cfg take_some [#"../inc_some_tree.rs" 61 4 61 39] [@cfg:stackify] [@cfg:subregion_analysis] (self : borrowed (IncSomeTree_Tree_Type.t_tree)) : borrowed uint32 ensures { [#"../inc_some_tree.rs" 59 14 59 64] Sum0.sum ( ^ self) - Sum0.sum ( * self) = UInt32.to_int ( ^ result) - ShallowModel0.shallow_model result } ensures { [#"../inc_some_tree.rs" 60 14 60 35] ShallowModel0.shallow_model result <= Sum0.sum ( * self) } @@ -342,11 +342,11 @@ module IncSomeTree_Impl0_TakeSome goto BB4 } BB2 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; goto BB15 } BB3 { - assume { Resolve0.resolve self }; + assume { Resolve2.resolve self }; absurd } BB4 { @@ -372,11 +372,11 @@ module IncSomeTree_Impl0_TakeSome ma <- { ma with current = ( ^ _15) }; _13 <- borrow_mut ( * _15); _15 <- { _15 with current = ( ^ _13) }; - assume { Resolve2.resolve _15 }; + assume { Resolve0.resolve _15 }; goto BB14 } BB7 { - assume { Resolve2.resolve ma }; + assume { Resolve0.resolve ma }; goto BB8 } BB8 { @@ -398,8 +398,8 @@ module IncSomeTree_Impl0_TakeSome _18 <- { _18 with current = ( ^ _17) }; _13 <- borrow_mut ( * _17); _17 <- { _17 with current = ( ^ _13) }; - assume { Resolve2.resolve _18 }; - assume { Resolve2.resolve _17 }; + assume { Resolve0.resolve _18 }; + assume { Resolve0.resolve _17 }; goto BB13 } BB11 { @@ -413,7 +413,7 @@ module IncSomeTree_Impl0_TakeSome BB12 { _13 <- borrow_mut ( * _20); _20 <- { _20 with current = ( ^ _13) }; - assume { Resolve2.resolve _20 }; + assume { Resolve0.resolve _20 }; goto BB13 } BB13 { @@ -424,18 +424,18 @@ module IncSomeTree_Impl0_TakeSome _13 <- { _13 with current = ( ^ _10) }; _5 <- borrow_mut ( * _10); _10 <- { _10 with current = ( ^ _5) }; - assume { Resolve2.resolve _13 }; - assume { Resolve2.resolve _10 }; + assume { Resolve0.resolve _13 }; + assume { Resolve0.resolve _10 }; assume { Resolve1.resolve mtr }; - assume { Resolve2.resolve ma }; + assume { Resolve0.resolve ma }; assume { Resolve1.resolve mtl }; _2 <- borrow_mut ( * _5); _5 <- { _5 with current = ( ^ _2) }; _0 <- borrow_mut ( * _2); _2 <- { _2 with current = ( ^ _0) }; - assume { Resolve2.resolve _5 }; - assume { Resolve2.resolve _2 }; - assume { Resolve0.resolve self }; + assume { Resolve0.resolve _5 }; + assume { Resolve0.resolve _2 }; + assume { Resolve2.resolve self }; return _0 } BB15 { diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3session.xml b/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3session.xml index 302d79da38..2eca5ba8b2 100644 --- a/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3session.xml +++ b/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3session.xml @@ -17,7 +17,7 @@ - + diff --git a/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3shapes.gz b/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3shapes.gz index 664f4b8d4b..79b9ccb77e 100644 Binary files a/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3shapes.gz and b/creusot/tests/should_succeed/rusthorn/inc_some_tree/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/selection_sort_generic.mlcfg b/creusot/tests/should_succeed/selection_sort_generic.mlcfg index ce75eecb11..a63c6276e4 100644 --- a/creusot/tests/should_succeed/selection_sort_generic.mlcfg +++ b/creusot/tests/should_succeed/selection_sort_generic.mlcfg @@ -873,7 +873,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -1012,7 +1012,7 @@ module CreusotContracts_Std1_Slice_Impl0_ShallowModel axiom shallow_model_spec : forall self : slice t . ([#"../../../../creusot-contracts/src/std/slice.rs" 19 14 19 41] shallow_model self = Slice.id self) && ([#"../../../../creusot-contracts/src/std/slice.rs" 18 14 18 41] Seq.length (shallow_model self) <= UIntSize.to_int Max0.mAX') end -module Alloc_Vec_Impl10_DerefMut_Interface +module Alloc_Vec_Impl9_DerefMut_Interface type t type a use prelude.Borrow @@ -1852,13 +1852,15 @@ module SelectionSortGeneric_SelectionSort val Max0.mAX' = Max0.mAX', axiom . clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = slice t clone Core_Slice_Impl0_Swap_Interface as Swap0 with type t = t, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, function ShallowModel1.shallow_model = ShallowModel6.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl10_DerefMut_Interface as DerefMut0 with + clone Alloc_Vec_Impl9_DerefMut_Interface as DerefMut0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, @@ -1873,9 +1875,9 @@ module SelectionSortGeneric_SelectionSort function DeepModel1.deep_model = DeepModel3.deep_model, function LtLog0.lt_log = LtLog0.lt_log, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = t - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1883,8 +1885,6 @@ module SelectionSortGeneric_SelectionSort predicate InBounds0.in_bounds = InBounds0.in_bounds, predicate HasValue0.has_value = HasValue0.has_value, type Output0.output = t - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Iter_Range_Impl3_Next_Interface as Next0 with type a = usize, @@ -2000,7 +2000,7 @@ module SelectionSortGeneric_SelectionSort end } BB9 { - assume { Resolve2.resolve v }; + assume { Resolve4.resolve v }; _0 <- (); return _0 } @@ -2083,12 +2083,12 @@ module SelectionSortGeneric_SelectionSort goto BB25 } BB25 { - assume { Resolve3.resolve _54 }; + assume { Resolve2.resolve _54 }; _58 <- ([#"../selection_sort_generic.rs" 44 22 44 28] Index0.index ( * v) min); goto BB26 } BB26 { - assume { Resolve3.resolve _58 }; + assume { Resolve2.resolve _58 }; goto BB27 } BB27 { @@ -2117,17 +2117,17 @@ module SelectionSortGeneric_SelectionSort goto BB32 } BB32 { - assume { Resolve4.resolve _65 }; + assume { Resolve3.resolve _65 }; assert { [@expl:assertion] [#"../selection_sort_generic.rs" 49 8 50 63] let i = Seq.length (Ghost.inner produced) in forall k2 : int . forall k1 : int . 0 <= k1 /\ k1 < i /\ i <= k2 /\ k2 < Seq.length (DeepModel0.deep_model v) -> LeLog0.le_log (Seq.get (DeepModel0.deep_model v) k1) (Seq.get (DeepModel0.deep_model v) k2) }; _19 <- (); goto BB6 } BB34 { - assume { Resolve2.resolve v }; + assume { Resolve4.resolve v }; goto BB11 } BB35 { - assume { Resolve2.resolve v }; + assume { Resolve4.resolve v }; goto BB11 } diff --git a/creusot/tests/should_succeed/selection_sort_generic/why3session.xml b/creusot/tests/should_succeed/selection_sort_generic/why3session.xml index 692c97bf86..7d59d7f992 100644 --- a/creusot/tests/should_succeed/selection_sort_generic/why3session.xml +++ b/creusot/tests/should_succeed/selection_sort_generic/why3session.xml @@ -2,7 +2,7 @@ - + @@ -38,31 +38,31 @@ - + - + - + - + - + - + @@ -74,7 +74,7 @@ - + @@ -83,41 +83,41 @@ - + - + - + - + - + - + - + - + - + - + diff --git a/creusot/tests/should_succeed/selection_sort_generic/why3shapes.gz b/creusot/tests/should_succeed/selection_sort_generic/why3shapes.gz index 4be7875844..dbfc963d19 100644 Binary files a/creusot/tests/should_succeed/selection_sort_generic/why3shapes.gz and b/creusot/tests/should_succeed/selection_sort_generic/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/slices/01.mlcfg b/creusot/tests/should_succeed/slices/01.mlcfg index 0dba58d587..1fd22db515 100644 --- a/creusot/tests/should_succeed/slices/01.mlcfg +++ b/creusot/tests/should_succeed/slices/01.mlcfg @@ -392,9 +392,9 @@ module C01_SliceFirst type t = t, type s = slice t, function ShallowModel0.shallow_model = ShallowModel0.shallow_model - use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = t + use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = slice t clone Core_Slice_Impl0_Len_Interface as Len0 with diff --git a/creusot/tests/should_succeed/slices/01/why3shapes.gz b/creusot/tests/should_succeed/slices/01/why3shapes.gz index ff13badb0f..a39fdf8b2a 100644 Binary files a/creusot/tests/should_succeed/slices/01/why3shapes.gz and b/creusot/tests/should_succeed/slices/01/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/sparse_array.mlcfg b/creusot/tests/should_succeed/sparse_array.mlcfg index 04f7e62b9d..5dd4047db7 100644 --- a/creusot/tests/should_succeed/sparse_array.mlcfg +++ b/creusot/tests/should_succeed/sparse_array.mlcfg @@ -466,7 +466,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -652,7 +652,7 @@ module SparseArray_Impl1_Get val Max0.mAX' = Max0.mAX' clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with type self = t - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -662,7 +662,7 @@ module SparseArray_Impl1_Get type Output0.output = t clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = SparseArray_Sparse_Type.t_sparse t - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -940,7 +940,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -1139,10 +1139,8 @@ module SparseArray_Impl1_Set function IndexLogic0.index_logic = IndexLogic2.index_logic, val Max0.mAX' = Max0.mAX' clone CreusotContracts_Resolve_Impl1_Resolve as Resolve4 with - type t = SparseArray_Sparse_Type.t_sparse t - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = usize - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut1 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut1 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1153,14 +1151,16 @@ module SparseArray_Impl1_Set predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere1.resolve_elswhere, type Output0.output = usize, val Max0.mAX' = Max0.mAX' - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with type self = Ghost.ghost_ty () clone SparseArray_Impl1_LemmaPermutation as LemmaPermutation0 with type t = t, predicate SparseInv0.sparse_inv = SparseInv0.sparse_inv, predicate IsElt0.is_elt = IsElt0.is_elt, axiom . - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = SparseArray_Sparse_Type.t_sparse t + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1172,7 +1172,7 @@ module SparseArray_Impl1_Set type t = t clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = t - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1264,7 +1264,7 @@ module SparseArray_Impl1_Set goto BB12 } BB12 { - assume { Resolve2.resolve _29 }; + assume { Resolve3.resolve _29 }; assert { [@expl:assertion] [#"../sparse_array.rs" 125 26 125 46] UIntSize.to_int (SparseArray_Sparse_Type.sparse_n ( * self)) < UIntSize.to_int (SparseArray_Sparse_Type.sparse_size ( * self)) }; _35 <- borrow_mut (SparseArray_Sparse_Type.sparse_idx ( * self)); self <- { self with current = (let SparseArray_Sparse_Type.C_Sparse a b c d e = * self in SparseArray_Sparse_Type.C_Sparse a b c ( ^ _35) e) }; @@ -1274,7 +1274,7 @@ module SparseArray_Impl1_Set } BB13 { _34 <- { _34 with current = SparseArray_Sparse_Type.sparse_n ( * self) }; - assume { Resolve3.resolve _34 }; + assume { Resolve4.resolve _34 }; _39 <- borrow_mut (SparseArray_Sparse_Type.sparse_back ( * self)); self <- { self with current = (let SparseArray_Sparse_Type.C_Sparse a b c d e = * self in SparseArray_Sparse_Type.C_Sparse a b c d ( ^ _39)) }; _38 <- ([#"../sparse_array.rs" 128 12 128 29] IndexMut1.index_mut _39 (SparseArray_Sparse_Type.sparse_n ( * self))); @@ -1283,14 +1283,14 @@ module SparseArray_Impl1_Set } BB14 { _38 <- { _38 with current = i }; - assume { Resolve3.resolve _38 }; + assume { Resolve4.resolve _38 }; self <- { self with current = (let SparseArray_Sparse_Type.C_Sparse a b c d e = * self in SparseArray_Sparse_Type.C_Sparse a ([#"../sparse_array.rs" 129 12 129 23] SparseArray_Sparse_Type.sparse_n ( * self) + ([#"../sparse_array.rs" 129 22 129 23] (1 : usize))) c d e) }; - assume { Resolve4.resolve self }; + assume { Resolve2.resolve self }; _0 <- (); goto BB16 } BB15 { - assume { Resolve4.resolve self }; + assume { Resolve2.resolve self }; _0 <- (); goto BB16 } diff --git a/creusot/tests/should_succeed/sparse_array/why3session.xml b/creusot/tests/should_succeed/sparse_array/why3session.xml index 76f9440498..7b08d7e7e1 100644 --- a/creusot/tests/should_succeed/sparse_array/why3session.xml +++ b/creusot/tests/should_succeed/sparse_array/why3session.xml @@ -4,8 +4,8 @@ + - @@ -48,37 +48,37 @@ - + - + - + - + - + - + - + - + - + diff --git a/creusot/tests/should_succeed/sparse_array/why3shapes.gz b/creusot/tests/should_succeed/sparse_array/why3shapes.gz index 91ab9fff7f..9bc4cb99df 100644 Binary files a/creusot/tests/should_succeed/sparse_array/why3shapes.gz and b/creusot/tests/should_succeed/sparse_array/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/switch_struct.mlcfg b/creusot/tests/should_succeed/switch_struct.mlcfg index 658a88f901..09a68000aa 100644 --- a/creusot/tests/should_succeed/switch_struct.mlcfg +++ b/creusot/tests/should_succeed/switch_struct.mlcfg @@ -6,16 +6,16 @@ module SwitchStruct_M_Type | C_F uint32 | C_G 't - let function g_field2 (self : t_m 't) : 't = [@vc:do_not_keep_trace] [@vc:sp] - match (self) with - | C_F _ -> any 't - | C_G a -> a - end let function f_field1 (self : t_m 't) : uint32 = [@vc:do_not_keep_trace] [@vc:sp] match (self) with | C_F a -> a | C_G _ -> any uint32 end + let function g_field2 (self : t_m 't) : 't = [@vc:do_not_keep_trace] [@vc:sp] + match (self) with + | C_F _ -> any 't + | C_G a -> a + end end module SwitchStruct_Test_Interface use prelude.Int diff --git a/creusot/tests/should_succeed/syntax/derive_macros.mlcfg b/creusot/tests/should_succeed/syntax/derive_macros.mlcfg index 1efbbc384a..3852592816 100644 --- a/creusot/tests/should_succeed/syntax/derive_macros.mlcfg +++ b/creusot/tests/should_succeed/syntax/derive_macros.mlcfg @@ -335,16 +335,16 @@ module DeriveMacros_Sum_Type | C_A 'a | C_B 'b - let function b_0 (self : t_sum 'a 'b) : 'b = [@vc:do_not_keep_trace] [@vc:sp] - match (self) with - | C_A _ -> any 'b - | C_B a -> a - end let function a_0 (self : t_sum 'a 'b) : 'a = [@vc:do_not_keep_trace] [@vc:sp] match (self) with | C_A a -> a | C_B _ -> any 'a end + let function b_0 (self : t_sum 'a 'b) : 'b = [@vc:do_not_keep_trace] [@vc:sp] + match (self) with + | C_A _ -> any 'b + | C_B a -> a + end end module DeriveMacros_Impl4_Clone_Interface type a @@ -360,17 +360,17 @@ module DeriveMacros_Impl4_Clone type b use prelude.Borrow clone Core_Clone_Clone_Clone_Interface as Clone1 with - type self = a + type self = b clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve4 with - type self = a + type self = b clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with - type self = a - clone Core_Clone_Clone_Clone_Interface as Clone0 with type self = b + clone Core_Clone_Clone_Clone_Interface as Clone0 with + type self = a clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with - type self = b + type self = a clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with - type self = b + type self = a use DeriveMacros_Sum_Type as DeriveMacros_Sum_Type clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = DeriveMacros_Sum_Type.t_sum a b @@ -400,7 +400,7 @@ module DeriveMacros_Impl4_Clone v0_11 <- DeriveMacros_Sum_Type.b_0 self; assume { Resolve0.resolve self }; _11 <- v0_11; - assume { Resolve1.resolve _11 }; + assume { Resolve3.resolve _11 }; goto BB7 } BB3 { @@ -411,20 +411,20 @@ module DeriveMacros_Impl4_Clone v0_1 <- DeriveMacros_Sum_Type.a_0 self; assume { Resolve0.resolve self }; _7 <- v0_1; - assume { Resolve3.resolve _7 }; + assume { Resolve1.resolve _7 }; goto BB5 } BB5 { - assume { Resolve4.resolve v0_1 }; - _0 <- DeriveMacros_Sum_Type.C_A ([#"../derive_macros.rs" 27 9 27 14] Clone1.clone' _7); + assume { Resolve2.resolve v0_1 }; + _0 <- DeriveMacros_Sum_Type.C_A ([#"../derive_macros.rs" 27 9 27 14] Clone0.clone' _7); goto BB6 } BB6 { goto BB9 } BB7 { - assume { Resolve2.resolve v0_11 }; - _0 <- DeriveMacros_Sum_Type.C_B ([#"../derive_macros.rs" 27 9 27 14] Clone0.clone' _11); + assume { Resolve4.resolve v0_11 }; + _0 <- DeriveMacros_Sum_Type.C_B ([#"../derive_macros.rs" 27 9 27 14] Clone1.clone' _11); goto BB8 } BB8 { @@ -532,51 +532,51 @@ module DeriveMacros_Impl5_Eq type b use prelude.Borrow clone CreusotContracts_Model_DeepModel_DeepModelTy_Type as DeepModelTy1 with - type self = a + type self = b clone CreusotContracts_Model_DeepModel_DeepModel_Interface as DeepModel5 with - type self = a, + type self = b, type DeepModelTy0.deepModelTy = DeepModelTy1.deepModelTy clone CreusotContracts_Model_DeepModel_DeepModelTy_Type as DeepModelTy0 with - type self = b + type self = a clone CreusotContracts_Model_DeepModel_DeepModel_Interface as DeepModel4 with - type self = b, + type self = a, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy use DeriveMacros_Sum_Type as DeriveMacros_Sum_Type clone DeriveMacros_Impl1_DeepModel as DeepModel3 with type a = a, type b = b, - type DeepModelTy0.deepModelTy = DeepModelTy1.deepModelTy, - type DeepModelTy1.deepModelTy = DeepModelTy0.deepModelTy, - function DeepModel0.deep_model = DeepModel5.deep_model, - function DeepModel1.deep_model = DeepModel4.deep_model + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, + type DeepModelTy1.deepModelTy = DeepModelTy1.deepModelTy, + function DeepModel0.deep_model = DeepModel4.deep_model, + function DeepModel1.deep_model = DeepModel5.deep_model clone CreusotContracts_Model_Impl4_DeepModel as DeepModel2 with - type t = a, + type t = b, type DeepModelTy0.deepModelTy = DeepModelTy1.deepModelTy, function DeepModel0.deep_model = DeepModel5.deep_model clone CreusotContracts_Model_Impl4_DeepModel as DeepModel1 with - type t = b, + type t = a, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, function DeepModel0.deep_model = DeepModel4.deep_model clone CreusotContracts_Model_Impl4_DeepModel as DeepModel0 with type t = DeriveMacros_Sum_Type.t_sum a b, - type DeepModelTy0.deepModelTy = DeriveMacros_Sum_Type.t_sum DeepModelTy1.deepModelTy DeepModelTy0.deepModelTy, + type DeepModelTy0.deepModelTy = DeriveMacros_Sum_Type.t_sum DeepModelTy0.deepModelTy DeepModelTy1.deepModelTy, function DeepModel0.deep_model = DeepModel3.deep_model clone Core_Cmp_PartialEq_Eq_Interface as Eq1 with - type self = a, - type rhs = a, + type self = b, + type rhs = b, function DeepModel0.deep_model = DeepModel2.deep_model, function DeepModel1.deep_model = DeepModel2.deep_model, type DeepModelTy0.deepModelTy = DeepModelTy1.deepModelTy clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve3 with - type self = a + type self = b clone Core_Cmp_PartialEq_Eq_Interface as Eq0 with - type self = b, - type rhs = b, + type self = a, + type rhs = a, function DeepModel0.deep_model = DeepModel1.deep_model, function DeepModel1.deep_model = DeepModel1.deep_model, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with - type self = b + type self = a clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = DeriveMacros_Sum_Type.t_sum a b clone CreusotContracts_Resolve_Impl0_Resolve as Resolve1 with @@ -635,8 +635,8 @@ module DeriveMacros_Impl5_Eq v0_1 <- DeriveMacros_Sum_Type.a_0 (let (a, _) = _4 in a); v0_2 <- DeriveMacros_Sum_Type.a_0 (let (_, a) = _4 in a); assume { Resolve1.resolve _4 }; - assume { Resolve3.resolve v0_1 }; - assume { Resolve3.resolve v0_2 }; + assume { Resolve2.resolve v0_1 }; + assume { Resolve2.resolve v0_2 }; goto BB10 } BB7 { @@ -651,7 +651,7 @@ module DeriveMacros_Impl5_Eq goto BB16 } BB10 { - switch ([#"../derive_macros.rs" 27 16 27 25] Eq1.eq v0_1 v0_2) + switch ([#"../derive_macros.rs" 27 16 27 25] Eq0.eq v0_1 v0_2) | False -> goto BB7 | True -> goto BB8 end @@ -660,8 +660,8 @@ module DeriveMacros_Impl5_Eq v0_11 <- DeriveMacros_Sum_Type.b_0 (let (a, _) = _4 in a); v0_21 <- DeriveMacros_Sum_Type.b_0 (let (_, a) = _4 in a); assume { Resolve1.resolve _4 }; - assume { Resolve2.resolve v0_11 }; - assume { Resolve2.resolve v0_21 }; + assume { Resolve3.resolve v0_11 }; + assume { Resolve3.resolve v0_21 }; goto BB15 } BB12 { @@ -676,7 +676,7 @@ module DeriveMacros_Impl5_Eq goto BB16 } BB15 { - switch ([#"../derive_macros.rs" 27 16 27 25] Eq0.eq v0_11 v0_21) + switch ([#"../derive_macros.rs" 27 16 27 25] Eq1.eq v0_11 v0_21) | False -> goto BB12 | True -> goto BB13 end diff --git a/creusot/tests/should_succeed/syntax/derive_macros/why3shapes.gz b/creusot/tests/should_succeed/syntax/derive_macros/why3shapes.gz index 776db95ba0..1982c625c5 100644 Binary files a/creusot/tests/should_succeed/syntax/derive_macros/why3shapes.gz and b/creusot/tests/should_succeed/syntax/derive_macros/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/take_first_mut.mlcfg b/creusot/tests/should_succeed/take_first_mut.mlcfg index 52fb5bae32..3604720413 100644 --- a/creusot/tests/should_succeed/take_first_mut.mlcfg +++ b/creusot/tests/should_succeed/take_first_mut.mlcfg @@ -361,9 +361,9 @@ module TakeFirstMut_TakeFirstMut function ShallowModel0.shallow_model = ShallowModel0.shallow_model clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with type t = t - use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = slice t + use Core_Option_Option_Type as Core_Option_Option_Type clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = borrowed (slice t) clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with diff --git a/creusot/tests/should_succeed/take_first_mut/why3session.xml b/creusot/tests/should_succeed/take_first_mut/why3session.xml index 2579da921f..59d9cafe4b 100644 --- a/creusot/tests/should_succeed/take_first_mut/why3session.xml +++ b/creusot/tests/should_succeed/take_first_mut/why3session.xml @@ -2,12 +2,12 @@ - + - + diff --git a/creusot/tests/should_succeed/take_first_mut/why3shapes.gz b/creusot/tests/should_succeed/take_first_mut/why3shapes.gz index f501d848f2..aada612454 100644 Binary files a/creusot/tests/should_succeed/take_first_mut/why3shapes.gz and b/creusot/tests/should_succeed/take_first_mut/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/vector/01.mlcfg b/creusot/tests/should_succeed/vector/01.mlcfg index fb9ec03c7c..bb2695ecf6 100644 --- a/creusot/tests/should_succeed/vector/01.mlcfg +++ b/creusot/tests/should_succeed/vector/01.mlcfg @@ -625,7 +625,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -1028,8 +1028,10 @@ module C01_AllZero type s = Alloc_Vec_Vec_Type.t_vec uint32 (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel2.shallow_model clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with + type t = Alloc_Vec_Vec_Type.t_vec uint32 (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with type t = uint32 - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = uint32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1040,8 +1042,6 @@ module C01_AllZero predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere0.resolve_elswhere, type Output0.output = uint32, val Max0.mAX' = Max0.mAX' - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with - type t = Alloc_Vec_Vec_Type.t_vec uint32 (Alloc_Alloc_Global_Type.t_global) use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Iter_Range_Impl3_Next_Interface as Next0 with type a = usize, @@ -1133,7 +1133,7 @@ module C01_AllZero end } BB9 { - assume { Resolve1.resolve v }; + assume { Resolve2.resolve v }; _0 <- (); return _0 } @@ -1141,7 +1141,7 @@ module C01_AllZero goto BB12 } BB11 { - assume { Resolve1.resolve v }; + assume { Resolve2.resolve v }; absurd } BB12 { @@ -1161,7 +1161,7 @@ module C01_AllZero } BB14 { _27 <- { _27 with current = ([#"../01.rs" 12 15 12 16] (0 : uint32)) }; - assume { Resolve2.resolve _27 }; + assume { Resolve1.resolve _27 }; goto BB6 } diff --git a/creusot/tests/should_succeed/vector/01/why3session.xml b/creusot/tests/should_succeed/vector/01/why3session.xml index f35bdd83c1..2ec5562f1d 100644 --- a/creusot/tests/should_succeed/vector/01/why3session.xml +++ b/creusot/tests/should_succeed/vector/01/why3session.xml @@ -7,7 +7,7 @@ - + diff --git a/creusot/tests/should_succeed/vector/01/why3shapes.gz b/creusot/tests/should_succeed/vector/01/why3shapes.gz index ac183a838c..a83df3950e 100644 Binary files a/creusot/tests/should_succeed/vector/01/why3shapes.gz and b/creusot/tests/should_succeed/vector/01/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/vector/02_gnome.mlcfg b/creusot/tests/should_succeed/vector/02_gnome.mlcfg index 210a58e52d..30a14ba901 100644 --- a/creusot/tests/should_succeed/vector/02_gnome.mlcfg +++ b/creusot/tests/should_succeed/vector/02_gnome.mlcfg @@ -625,7 +625,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -742,7 +742,7 @@ module CreusotContracts_Std1_Slice_Impl0_ShallowModel axiom shallow_model_spec : forall self : slice t . ([#"../../../../../creusot-contracts/src/std/slice.rs" 19 14 19 41] shallow_model self = Slice.id self) && ([#"../../../../../creusot-contracts/src/std/slice.rs" 18 14 18 41] Seq.length (shallow_model self) <= UIntSize.to_int Max0.mAX') end -module Alloc_Vec_Impl10_DerefMut_Interface +module Alloc_Vec_Impl9_DerefMut_Interface type t type a use prelude.Borrow @@ -1391,15 +1391,13 @@ module C02Gnome_GnomeSort val Max0.mAX' = Max0.mAX', axiom . clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = slice t clone Core_Slice_Impl0_Swap_Interface as Swap0 with type t = t, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, function ShallowModel1.shallow_model = ShallowModel6.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl10_DerefMut_Interface as DerefMut0 with + clone Alloc_Vec_Impl9_DerefMut_Interface as DerefMut0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, @@ -1414,9 +1412,9 @@ module C02Gnome_GnomeSort function DeepModel1.deep_model = DeepModel2.deep_model, function LeLog0.le_log = LeLog0.le_log, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = t - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1424,6 +1422,8 @@ module C02Gnome_GnomeSort predicate InBounds0.in_bounds = InBounds0.in_bounds, predicate HasValue0.has_value = HasValue0.has_value, type Output0.output = t + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve1 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) clone Alloc_Vec_Impl1_Len_Interface as Len0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, @@ -1505,14 +1505,14 @@ module C02Gnome_GnomeSort end } BB9 { - assume { Resolve1.resolve _19 }; + assume { Resolve2.resolve _19 }; _25 <- ([#"../02_gnome.rs" 31 34 31 38] Index0.index ( * v) i); goto BB10 } BB10 { _24 <- _25; - assume { Resolve1.resolve _25 }; - assume { Resolve1.resolve _24 }; + assume { Resolve2.resolve _25 }; + assume { Resolve2.resolve _24 }; goto BB11 } BB11 { @@ -1539,7 +1539,7 @@ module C02Gnome_GnomeSort goto BB15 } BB15 { - assume { Resolve2.resolve _30 }; + assume { Resolve3.resolve _30 }; i <- ([#"../02_gnome.rs" 35 12 35 18] i - ([#"../02_gnome.rs" 35 17 35 18] (1 : usize))); _9 <- (); goto BB16 @@ -1548,7 +1548,7 @@ module C02Gnome_GnomeSort goto BB2 } BB17 { - assume { Resolve3.resolve v }; + assume { Resolve1.resolve v }; _0 <- (); return _0 } diff --git a/creusot/tests/should_succeed/vector/02_gnome/why3session.xml b/creusot/tests/should_succeed/vector/02_gnome/why3session.xml index b63b3e77b1..c95966f4cc 100644 --- a/creusot/tests/should_succeed/vector/02_gnome/why3session.xml +++ b/creusot/tests/should_succeed/vector/02_gnome/why3session.xml @@ -24,7 +24,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -47,15 +47,15 @@ - + - + - + diff --git a/creusot/tests/should_succeed/vector/02_gnome/why3shapes.gz b/creusot/tests/should_succeed/vector/02_gnome/why3shapes.gz index 8452d1949f..a4cd812dc9 100644 Binary files a/creusot/tests/should_succeed/vector/02_gnome/why3shapes.gz and b/creusot/tests/should_succeed/vector/02_gnome/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/vector/03_knuth_shuffle.mlcfg b/creusot/tests/should_succeed/vector/03_knuth_shuffle.mlcfg index 3e95f9c9d7..562e102160 100644 --- a/creusot/tests/should_succeed/vector/03_knuth_shuffle.mlcfg +++ b/creusot/tests/should_succeed/vector/03_knuth_shuffle.mlcfg @@ -585,7 +585,7 @@ module CreusotContracts_Std1_Slice_Impl0_ShallowModel axiom shallow_model_spec : forall self : slice t . ([#"../../../../../creusot-contracts/src/std/slice.rs" 19 14 19 41] shallow_model self = Slice.id self) && ([#"../../../../../creusot-contracts/src/std/slice.rs" 18 14 18 41] Seq.length (shallow_model self) <= UIntSize.to_int Max0.mAX') end -module Alloc_Vec_Impl10_DerefMut_Interface +module Alloc_Vec_Impl9_DerefMut_Interface type t type a use prelude.Borrow @@ -911,13 +911,15 @@ module C03KnuthShuffle_KnuthShuffle function ShallowModel0.shallow_model = ShallowModel2.shallow_model use prelude.Ghost clone CreusotContracts_Resolve_Impl1_Resolve as Resolve3 with + type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) + clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with type t = slice t clone Core_Slice_Impl0_Swap_Interface as Swap0 with type t = t, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, function ShallowModel1.shallow_model = ShallowModel6.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl10_DerefMut_Interface as DerefMut0 with + clone Alloc_Vec_Impl9_DerefMut_Interface as DerefMut0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel5.shallow_model, @@ -926,8 +928,6 @@ module C03KnuthShuffle_KnuthShuffle function ShallowModel3.shallow_model = ShallowModel2.shallow_model, val Max0.mAX' = Max0.mAX' clone C03KnuthShuffle_RandInRange_Interface as RandInRange0 - clone CreusotContracts_Resolve_Impl1_Resolve as Resolve2 with - type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) use Core_Option_Option_Type as Core_Option_Option_Type clone Core_Iter_Range_Impl3_Next_Interface as Next0 with type a = usize, @@ -1022,7 +1022,7 @@ module C03KnuthShuffle_KnuthShuffle end } BB9 { - assume { Resolve2.resolve v }; + assume { Resolve3.resolve v }; _0 <- (); return _0 } @@ -1030,7 +1030,7 @@ module C03KnuthShuffle_KnuthShuffle goto BB12 } BB11 { - assume { Resolve2.resolve v }; + assume { Resolve3.resolve v }; absurd } BB12 { @@ -1064,7 +1064,7 @@ module C03KnuthShuffle_KnuthShuffle goto BB17 } BB17 { - assume { Resolve3.resolve _33 }; + assume { Resolve2.resolve _33 }; goto BB6 } diff --git a/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3session.xml b/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3session.xml index 7f2ac44d48..8e7ed99ef8 100644 --- a/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3session.xml +++ b/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3session.xml @@ -7,7 +7,7 @@ - + diff --git a/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3shapes.gz b/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3shapes.gz index 299a7242ad..6682bf6884 100644 Binary files a/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3shapes.gz and b/creusot/tests/should_succeed/vector/03_knuth_shuffle/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/vector/04_binary_search.mlcfg b/creusot/tests/should_succeed/vector/04_binary_search.mlcfg index d7aa2eb144..3818b028eb 100644 --- a/creusot/tests/should_succeed/vector/04_binary_search.mlcfg +++ b/creusot/tests/should_succeed/vector/04_binary_search.mlcfg @@ -279,7 +279,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -452,11 +452,12 @@ module C04BinarySearch_BinarySearch use seq.Seq clone C04BinarySearch_Sorted as Sorted0 with predicate SortedRange0.sorted_range = SortedRange0.sorted_range + use Core_Result_Result_Type as Core_Result_Result_Type clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel0 with type t = Alloc_Vec_Vec_Type.t_vec uint32 (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq uint32, function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = uint32, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -468,7 +469,6 @@ module C04BinarySearch_BinarySearch type t = uint32, type s = Alloc_Vec_Vec_Type.t_vec uint32 (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - use Core_Result_Result_Type as Core_Result_Result_Type clone Alloc_Vec_Impl1_Len_Interface as Len0 with type t = uint32, type a = Alloc_Alloc_Global_Type.t_global, diff --git a/creusot/tests/should_succeed/vector/04_binary_search/why3session.xml b/creusot/tests/should_succeed/vector/04_binary_search/why3session.xml index 93a93d0497..9185220084 100644 --- a/creusot/tests/should_succeed/vector/04_binary_search/why3session.xml +++ b/creusot/tests/should_succeed/vector/04_binary_search/why3session.xml @@ -27,7 +27,7 @@ - + @@ -42,22 +42,22 @@ - + - + - + - + - + diff --git a/creusot/tests/should_succeed/vector/04_binary_search/why3shapes.gz b/creusot/tests/should_succeed/vector/04_binary_search/why3shapes.gz index 66705c6d55..bc3ada307e 100644 Binary files a/creusot/tests/should_succeed/vector/04_binary_search/why3shapes.gz and b/creusot/tests/should_succeed/vector/04_binary_search/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/vector/05_binary_search_generic.mlcfg b/creusot/tests/should_succeed/vector/05_binary_search_generic.mlcfg index 1ee87dc4c9..76d03e8d80 100644 --- a/creusot/tests/should_succeed/vector/05_binary_search_generic.mlcfg +++ b/creusot/tests/should_succeed/vector/05_binary_search_generic.mlcfg @@ -398,7 +398,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -426,6 +426,21 @@ module Alloc_Vec_Impl13_Index_Interface requires {[#"../../../../../creusot-contracts/src/std/vec.rs" 131 27 131 46] InBounds0.in_bounds index (ShallowModel0.shallow_model self)} ensures { [#"../../../../../creusot-contracts/src/std/vec.rs" 132 26 132 54] HasValue0.has_value index (ShallowModel0.shallow_model self) result } +end +module Core_Cmp_Ord_Cmp_Interface + type self + use prelude.Borrow + clone CreusotContracts_Model_DeepModel_DeepModelTy_Type as DeepModelTy0 with + type self = self + use Core_Cmp_Ordering_Type as Core_Cmp_Ordering_Type + clone CreusotContracts_Logic_Ord_OrdLogic_CmpLog_Stub as CmpLog0 with + type self = DeepModelTy0.deepModelTy + clone CreusotContracts_Model_DeepModel_DeepModel_Stub as DeepModel0 with + type self = self, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy + val cmp (self : self) (other : self) : Core_Cmp_Ordering_Type.t_ordering + ensures { [#"../../../../../creusot-contracts/src/std/cmp.rs" 44 26 44 85] result = CmpLog0.cmp_log (DeepModel0.deep_model self) (DeepModel0.deep_model other) } + end module CreusotContracts_Logic_Ord_OrdLogic_GtLog_Stub type self @@ -466,21 +481,6 @@ module Core_Cmp_PartialOrd_Gt_Interface val gt (self : self) (other : rhs) : bool ensures { [#"../../../../../creusot-contracts/src/std/cmp.rs" 33 26 33 76] result = GtLog0.gt_log (DeepModel0.deep_model self) (DeepModel1.deep_model other) } -end -module Core_Cmp_Ord_Cmp_Interface - type self - use prelude.Borrow - clone CreusotContracts_Model_DeepModel_DeepModelTy_Type as DeepModelTy0 with - type self = self - use Core_Cmp_Ordering_Type as Core_Cmp_Ordering_Type - clone CreusotContracts_Logic_Ord_OrdLogic_CmpLog_Stub as CmpLog0 with - type self = DeepModelTy0.deepModelTy - clone CreusotContracts_Model_DeepModel_DeepModel_Stub as DeepModel0 with - type self = self, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy - val cmp (self : self) (other : self) : Core_Cmp_Ordering_Type.t_ordering - ensures { [#"../../../../../creusot-contracts/src/std/cmp.rs" 44 26 44 85] result = CmpLog0.cmp_log (DeepModel0.deep_model self) (DeepModel0.deep_model other) } - end module CreusotContracts_Std1_Vec_Impl0_ShallowModel_Stub type t @@ -1083,9 +1083,6 @@ module C05BinarySearchGeneric_BinarySearch clone C05BinarySearchGeneric_SortedRange as SortedRange0 with type t = DeepModelTy0.deepModelTy, function LeLog0.le_log = LeLog0.le_log - use Core_Cmp_Ordering_Type as Core_Cmp_Ordering_Type - clone CreusotContracts_Logic_Ord_OrdLogic_CmpLog_Interface as CmpLog0 with - type self = DeepModelTy0.deepModelTy clone CreusotContracts_Logic_Ord_OrdLogic_GtLog_Interface as GtLog0 with type self = DeepModelTy0.deepModelTy clone CreusotContracts_Model_DeepModel_DeepModel_Interface as DeepModel1 with @@ -1095,6 +1092,9 @@ module C05BinarySearchGeneric_BinarySearch type t = t, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy, function DeepModel0.deep_model = DeepModel1.deep_model + use Core_Cmp_Ordering_Type as Core_Cmp_Ordering_Type + clone CreusotContracts_Logic_Ord_OrdLogic_CmpLog_Interface as CmpLog0 with + type self = DeepModelTy0.deepModelTy clone CreusotContracts_Std1_Slice_Impl5_HasValue as HasValue0 with type t = t clone CreusotContracts_Std1_Slice_Impl5_InBounds as InBounds0 with @@ -1153,11 +1153,6 @@ module C05BinarySearchGeneric_BinarySearch clone C05BinarySearchGeneric_Sorted as Sorted0 with type t = DeepModelTy0.deepModelTy, predicate SortedRange0.sorted_range = SortedRange0.sorted_range - clone Core_Cmp_Ord_Cmp_Interface as Cmp0 with - type self = t, - function DeepModel0.deep_model = DeepModel1.deep_model, - function CmpLog0.cmp_log = CmpLog0.cmp_log, - type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy clone Core_Cmp_PartialOrd_Gt_Interface as Gt0 with type self = t, type rhs = t, @@ -1165,13 +1160,21 @@ module C05BinarySearchGeneric_BinarySearch function DeepModel1.deep_model = DeepModel3.deep_model, function GtLog0.gt_log = GtLog0.gt_log, type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy + use Core_Result_Result_Type as Core_Result_Result_Type + clone Core_Cmp_Ord_Cmp_Interface as Cmp0 with + type self = t, + function DeepModel0.deep_model = DeepModel1.deep_model, + function CmpLog0.cmp_log = CmpLog0.cmp_log, + type DeepModelTy0.deepModelTy = DeepModelTy0.deepModelTy clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = t + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with + type self = t clone CreusotContracts_Model_Impl5_ShallowModel as ShallowModel0 with type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), type ShallowModelTy0.shallowModelTy = Seq.seq t, function ShallowModel0.shallow_model = ShallowModel1.shallow_model - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -1179,15 +1182,12 @@ module C05BinarySearchGeneric_BinarySearch predicate InBounds0.in_bounds = InBounds0.in_bounds, predicate HasValue0.has_value = HasValue0.has_value, type Output0.output = t + clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with + type self = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) clone CreusotContracts_Model_Impl4_DeepModel as DeepModel0 with type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global), type DeepModelTy0.deepModelTy = Seq.seq DeepModelTy0.deepModelTy, function DeepModel0.deep_model = DeepModel2.deep_model - use Core_Result_Result_Type as Core_Result_Result_Type - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve1 with - type self = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) - clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with - type self = t clone Alloc_Vec_Impl1_Len_Interface as Len0 with type t = t, type a = Alloc_Alloc_Global_Type.t_global, @@ -1235,8 +1235,8 @@ module C05BinarySearchGeneric_BinarySearch end } BB5 { - assume { Resolve0.resolve elem }; - assume { Resolve1.resolve arr }; + assume { Resolve2.resolve elem }; + assume { Resolve0.resolve arr }; _0 <- Core_Result_Result_Type.C_Err ([#"../05_binary_search_generic.rs" 32 19 32 20] (0 : usize)); goto BB29 } @@ -1281,7 +1281,7 @@ module C05BinarySearchGeneric_BinarySearch goto BB15 } BB15 { - assume { Resolve2.resolve _32 }; + assume { Resolve1.resolve _32 }; goto BB16 } BB16 { @@ -1305,20 +1305,20 @@ module C05BinarySearchGeneric_BinarySearch goto BB11 } BB20 { - assume { Resolve1.resolve arr }; + assume { Resolve0.resolve arr }; _41 <- ([#"../05_binary_search_generic.rs" 49 15 49 24] Index0.index arr base); goto BB21 } BB21 { cmp <- _41; - assume { Resolve2.resolve _41 }; - assume { Resolve2.resolve cmp }; + assume { Resolve1.resolve _41 }; + assume { Resolve1.resolve cmp }; _47 <- elem; - assume { Resolve2.resolve _47 }; + assume { Resolve1.resolve _47 }; goto BB22 } BB22 { - assume { Resolve0.resolve elem }; + assume { Resolve2.resolve elem }; switch ([#"../05_binary_search_generic.rs" 51 10 51 24] Cmp0.cmp cmp _47) | Core_Cmp_Ordering_Type.C_Less -> goto BB23 | Core_Cmp_Ordering_Type.C_Equal -> goto BB24 diff --git a/creusot/tests/should_succeed/vector/05_binary_search_generic/why3session.xml b/creusot/tests/should_succeed/vector/05_binary_search_generic/why3session.xml index 7894f28e9d..1aa53d8616 100644 --- a/creusot/tests/should_succeed/vector/05_binary_search_generic/why3session.xml +++ b/creusot/tests/should_succeed/vector/05_binary_search_generic/why3session.xml @@ -10,7 +10,7 @@ - + @@ -25,10 +25,10 @@ - + - + @@ -40,25 +40,25 @@ - + - + - + - + - + - + diff --git a/creusot/tests/should_succeed/vector/05_binary_search_generic/why3shapes.gz b/creusot/tests/should_succeed/vector/05_binary_search_generic/why3shapes.gz index 29d1f16668..834ea7f78f 100644 Binary files a/creusot/tests/should_succeed/vector/05_binary_search_generic/why3shapes.gz and b/creusot/tests/should_succeed/vector/05_binary_search_generic/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/vector/06_knights_tour.mlcfg b/creusot/tests/should_succeed/vector/06_knights_tour.mlcfg index 639d4f40f5..be1bc03906 100644 --- a/creusot/tests/should_succeed/vector/06_knights_tour.mlcfg +++ b/creusot/tests/should_succeed/vector/06_knights_tour.mlcfg @@ -1935,7 +1935,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -2079,7 +2079,7 @@ module C06KnightsTour_Impl1_Available function IndexLogic0.index_logic = IndexLogic0.index_logic, function ShallowModel1.shallow_model = ShallowModel3.shallow_model, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl13_Index_Interface as Index1 with + clone Alloc_Vec_Impl12_Index_Interface as Index1 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2087,7 +2087,7 @@ module C06KnightsTour_Impl1_Available predicate InBounds0.in_bounds = InBounds2.in_bounds, predicate HasValue0.has_value = HasValue1.has_value, type Output0.output = usize - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -2266,38 +2266,6 @@ module CreusotContracts_Std1_Vec_Impl8_Produces val produces (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) (visited : Seq.seq t) (rhs : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) : bool ensures { result = produces self visited rhs } -end -module CreusotContracts_Std1_Vec_Impl11_Resolve_Stub - type t - type a - use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type - predicate resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) -end -module CreusotContracts_Std1_Vec_Impl11_Resolve_Interface - type t - type a - use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type - predicate resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) - val resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) : bool - ensures { result = resolve self } - -end -module CreusotContracts_Std1_Vec_Impl11_Resolve - type t - type a - use prelude.Int - use seq.Seq - clone CreusotContracts_Resolve_Resolve_Resolve_Stub as Resolve0 with - type self = t - use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type - clone CreusotContracts_Std1_Vec_Impl6_ShallowModel_Stub as ShallowModel0 with - type t = t, - type a = a - predicate resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) = - [#"../../../../../creusot-contracts/src/std/vec.rs" 212 8 212 85] forall i : int . 0 <= i /\ i < Seq.length (ShallowModel0.shallow_model self) -> Resolve0.resolve (Seq.get (ShallowModel0.shallow_model self) i) - val resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) : bool - ensures { result = resolve self } - end module Core_Option_Option_Type type t_option 't = @@ -2335,6 +2303,38 @@ module CreusotContracts_Resolve_Impl0_Resolve val resolve (self : (t1, t2)) : bool ensures { result = resolve self } +end +module CreusotContracts_Std1_Vec_Impl11_Resolve_Stub + type t + type a + use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type + predicate resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) +end +module CreusotContracts_Std1_Vec_Impl11_Resolve_Interface + type t + type a + use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type + predicate resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) + val resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) : bool + ensures { result = resolve self } + +end +module CreusotContracts_Std1_Vec_Impl11_Resolve + type t + type a + use prelude.Int + use seq.Seq + clone CreusotContracts_Resolve_Resolve_Resolve_Stub as Resolve0 with + type self = t + use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type + clone CreusotContracts_Std1_Vec_Impl6_ShallowModel_Stub as ShallowModel0 with + type t = t, + type a = a + predicate resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) = + [#"../../../../../creusot-contracts/src/std/vec.rs" 212 8 212 85] forall i : int . 0 <= i /\ i < Seq.length (ShallowModel0.shallow_model self) -> Resolve0.resolve (Seq.get (ShallowModel0.shallow_model self) i) + val resolve (self : Alloc_Vec_IntoIter_IntoIter_Type.t_intoiter t a) : bool + ensures { result = resolve self } + end module C06KnightsTour_Moves_Interface use seq.Seq @@ -2419,7 +2419,7 @@ module CreusotContracts_Std1_Vec_Impl3_IntoIterPost ensures { result = into_iter_post self res } end -module Alloc_Vec_Impl16_IntoIter_Interface +module Alloc_Vec_Impl15_IntoIter_Interface type t type a use Alloc_Vec_IntoIter_IntoIter_Type as Alloc_Vec_IntoIter_IntoIter_Type @@ -2758,20 +2758,20 @@ module C06KnightsTour_Impl1_CountDegree function IndexLogic0.index_logic = IndexLogic1.index_logic, function ShallowModel1.shallow_model = ShallowModel3.shallow_model, val Max0.mAX' = Max0.mAX' - clone C06KnightsTour_Impl1_Available_Interface as Available0 with - predicate Wf0.wf = Wf0.wf, - predicate InBounds0.in_bounds = InBounds0.in_bounds - clone C06KnightsTour_Impl0_Mov_Interface as Mov0 - clone CreusotContracts_Resolve_Impl0_Resolve as Resolve2 with + clone CreusotContracts_Resolve_Impl0_Resolve as Resolve1 with type t1 = isize, type t2 = isize, predicate Resolve0.resolve = Resolve3.resolve, predicate Resolve1.resolve = Resolve3.resolve - clone CreusotContracts_Std1_Vec_Impl11_Resolve as Resolve1 with + clone CreusotContracts_Std1_Vec_Impl11_Resolve as Resolve2 with type t = (isize, isize), type a = Alloc_Alloc_Global_Type.t_global, function ShallowModel0.shallow_model = ShallowModel1.shallow_model, - predicate Resolve0.resolve = Resolve2.resolve + predicate Resolve0.resolve = Resolve1.resolve + clone C06KnightsTour_Impl1_Available_Interface as Available0 with + predicate Wf0.wf = Wf0.wf, + predicate InBounds0.in_bounds = InBounds0.in_bounds + clone C06KnightsTour_Impl0_Mov_Interface as Mov0 use Core_Option_Option_Type as Core_Option_Option_Type clone Alloc_Vec_IntoIter_Impl5_Next_Interface as Next0 with type t = (isize, isize), @@ -2779,7 +2779,7 @@ module C06KnightsTour_Impl1_CountDegree type Item0.item = (isize, isize), predicate Completed0.completed = Completed0.completed, predicate Produces0.produces = Produces0.produces - clone Alloc_Vec_Impl16_IntoIter_Interface as IntoIter0 with + clone Alloc_Vec_Impl15_IntoIter_Interface as IntoIter0 with type t = (isize, isize), type a = Alloc_Alloc_Global_Type.t_global, predicate IntoIterPre0.into_iter_pre = IntoIterPre0.into_iter_pre, @@ -2861,14 +2861,14 @@ module C06KnightsTour_Impl1_CountDegree end } BB10 { - assume { Resolve1.resolve iter }; + assume { Resolve2.resolve iter }; goto BB20 } BB11 { goto BB13 } BB12 { - assume { Resolve1.resolve iter }; + assume { Resolve2.resolve iter }; absurd } BB13 { @@ -2880,13 +2880,13 @@ module C06KnightsTour_Impl1_CountDegree produced <- _22; _22 <- any Ghost.ghost_ty (Seq.seq (isize, isize)); m <- __creusot_proc_iter_elem; - assume { Resolve2.resolve __creusot_proc_iter_elem }; + assume { Resolve1.resolve __creusot_proc_iter_elem }; _28 <- m; next <- ([#"../06_knights_tour.rs" 75 23 75 32] Mov0.mov p _28); goto BB15 } BB15 { - assume { Resolve2.resolve m }; + assume { Resolve1.resolve m }; goto BB16 } BB16 { @@ -2943,7 +2943,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -3086,7 +3086,7 @@ module C06KnightsTour_Impl1_Set type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global) clone CreusotContracts_Resolve_Impl1_Resolve as Resolve0 with type t = usize - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut1 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut1 with type t = usize, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -3097,7 +3097,7 @@ module C06KnightsTour_Impl1_Set predicate ResolveElswhere0.resolve_elswhere = ResolveElswhere1.resolve_elswhere, type Output0.output = usize, val Max0.mAX' = Max0.mAX' - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = Alloc_Vec_Vec_Type.t_vec usize (Alloc_Alloc_Global_Type.t_global), type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -3360,7 +3360,7 @@ module CreusotContracts_Std1_Vec_Impl4_IntoIterPost ensures { result = into_iter_post self res } end -module Alloc_Vec_Impl17_IntoIter_Interface +module Alloc_Vec_Impl16_IntoIter_Interface type t type a use prelude.Borrow @@ -3675,7 +3675,7 @@ module C06KnightsTour_Min type t = (usize, C06KnightsTour_Point_Type.t_point), type s = Alloc_Vec_Vec_Type.t_vec (usize, C06KnightsTour_Point_Type.t_point) (Alloc_Alloc_Global_Type.t_global), function ShallowModel0.shallow_model = ShallowModel0.shallow_model - clone Alloc_Vec_Impl17_IntoIter_Interface as IntoIter0 with + clone Alloc_Vec_Impl16_IntoIter_Interface as IntoIter0 with type t = (usize, C06KnightsTour_Point_Type.t_point), type a = Alloc_Alloc_Global_Type.t_global, predicate IntoIterPre0.into_iter_pre = IntoIterPre0.into_iter_pre, @@ -4254,7 +4254,7 @@ module C06KnightsTour_KnightsTour type Item0.item = (isize, isize), predicate Completed0.completed = Completed1.completed, predicate Produces0.produces = Produces1.produces - clone Alloc_Vec_Impl16_IntoIter_Interface as IntoIter1 with + clone Alloc_Vec_Impl15_IntoIter_Interface as IntoIter1 with type t = (isize, isize), type a = Alloc_Alloc_Global_Type.t_global, predicate IntoIterPre0.into_iter_pre = IntoIterPre1.into_iter_pre, diff --git a/creusot/tests/should_succeed/vector/06_knights_tour/why3session.xml b/creusot/tests/should_succeed/vector/06_knights_tour/why3session.xml index 7fa66856ce..9ca7dd01fb 100644 --- a/creusot/tests/should_succeed/vector/06_knights_tour/why3session.xml +++ b/creusot/tests/should_succeed/vector/06_knights_tour/why3session.xml @@ -42,7 +42,7 @@ - + @@ -56,14 +56,14 @@ - + - + @@ -71,15 +71,15 @@ - + - + - + diff --git a/creusot/tests/should_succeed/vector/06_knights_tour/why3shapes.gz b/creusot/tests/should_succeed/vector/06_knights_tour/why3shapes.gz index 0a771f319d..d7f27b069f 100644 Binary files a/creusot/tests/should_succeed/vector/06_knights_tour/why3shapes.gz and b/creusot/tests/should_succeed/vector/06_knights_tour/why3shapes.gz differ diff --git a/creusot/tests/should_succeed/vector/07_read_write.mlcfg b/creusot/tests/should_succeed/vector/07_read_write.mlcfg index 5e564694ff..a006c8efd6 100644 --- a/creusot/tests/should_succeed/vector/07_read_write.mlcfg +++ b/creusot/tests/should_succeed/vector/07_read_write.mlcfg @@ -286,7 +286,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_ResolveElswhere ensures { result = resolve_elswhere self old' fin } end -module Alloc_Vec_Impl14_IndexMut_Interface +module Alloc_Vec_Impl13_IndexMut_Interface type t type i type a @@ -359,7 +359,7 @@ module CreusotContracts_Model_Impl5_ShallowModel ensures { result = shallow_model self } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -611,7 +611,7 @@ module C07ReadWrite_ReadWrite type t = Alloc_Vec_Vec_Type.t_vec t (Alloc_Alloc_Global_Type.t_global) clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve2 with type self = t - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, @@ -623,7 +623,7 @@ module C07ReadWrite_ReadWrite type t = t clone CreusotContracts_Resolve_Resolve_Resolve_Interface as Resolve0 with type self = t - clone Alloc_Vec_Impl14_IndexMut_Interface as IndexMut0 with + clone Alloc_Vec_Impl13_IndexMut_Interface as IndexMut0 with type t = t, type i = usize, type a = Alloc_Alloc_Global_Type.t_global, diff --git a/creusot/tests/should_succeed/vector/08_haystack.mlcfg b/creusot/tests/should_succeed/vector/08_haystack.mlcfg index f3511f84ad..8202dea71d 100644 --- a/creusot/tests/should_succeed/vector/08_haystack.mlcfg +++ b/creusot/tests/should_succeed/vector/08_haystack.mlcfg @@ -904,7 +904,7 @@ module CreusotContracts_Std1_Slice_SliceIndex_HasValue ensures { result = has_value self seq out } end -module Alloc_Vec_Impl13_Index_Interface +module Alloc_Vec_Impl12_Index_Interface type t type i type a @@ -1478,7 +1478,7 @@ module C08Haystack_Search type i = Core_Ops_Range_RangeInclusive_Type.t_rangeinclusive usize clone CreusotContracts_Std1_Iter_Impl0_IntoIterPre as IntoIterPre0 with type i = Core_Ops_Range_RangeInclusive_Type.t_rangeinclusive usize - clone Alloc_Vec_Impl13_Index_Interface as Index0 with + clone Alloc_Vec_Impl12_Index_Interface as Index0 with type t = uint8, type i = usize, type a = Alloc_Alloc_Global_Type.t_global,