pub fn codegen_unimplemented(
        &mut self,
        operation_name: &str,
        t: Type,
        loc: Location,
        url: &str,
    ) -> Expr {
        // We should possibly upgrade this to a warning in the future, but for now emit at least something
        debug!("codegen_unimplemented: {} at {}", operation_name, loc.short_string());

        let body = vec![
            // Assert false to alert the user that there is a path that uses an unimplemented feature.
            Stmt::assert_false(&GotocCtx::unsupported_msg(operation_name, Some(url)), loc.clone()),
            // Assume false to block any further exploration of this path.
            Stmt::assume(Expr::bool_false(), loc.clone()),
            t.nondet().as_stmt(loc.clone()).with_location(loc.clone()), //TODO assume rust validity contraints
        ];

        Expr::statement_expression(body, t).with_location(loc)
    }
/// Kani does not currently support all MIR constructs.
/// When we hit a construct we don't handle, we have two choices:
/// We can use the `unimplemented!()` macro, which causes a compile time failure.
/// Or, we can use this function, which inserts an `assert(false, "FOO is not currently supported by Kani")` into the generated code.
/// This means that if the unimplemented feature is dynamically used by the code being verified, we will see an assertion failure.
/// If it is not used, we the assertion will pass.
/// This allows us to continue to make progress parsing rust code, while remaining sound (thanks to the `assert(false)`)
///
/// TODO: https://github.com/model-checking/kani/issues/8 assume the required validity constraints for the nondet return
/// TODO: https://github.com/model-checking/kani/issues/9 Have a parameter that decides whether to `assume(0)` to block further traces or not
Kani does not currently support all MIR constructs.
When we hit a construct we don't handle, we have two choices:
We can use the `unimplemented!()` macro, which causes a compile time failure.
Or, we can use this function, which inserts an `assert(false, "FOO is not currently supported by Kani")` into the generated code.
This means that if the unimplemented feature is dynamically used by the code being verified, we will see an assertion failure.
If it is not used, we the assertion will pass.
This allows us to continue to make progress parsing rust code, while remaining sound (thanks to the `assert(false)`)


Kani does not currently support all MIR constructs . When we hit a construct we don ' t handle we have two choices : We can use the ` unimplemented! () ` macro which causes a compile time failure . Or we can use this function which inserts an ` assert ( false " FOO is not currently supported by Kani " ) ` into the generated code . This means that if the unimplemented feature is dynamically used by the code being verified we will see an assertion failure . If it is not used we the assertion will pass . This allows us to continue to make progress parsing rust code while remaining sound ( thanks to the ` assert ( false ) ` )
pub fn codegen_unimplemented(
        &mut self,
        operation_name: &str,
        t: Type,
        loc: Location,
        url: &str,
    ) -> Expr {
        // We should possibly upgrade this to a warning in the future, but for now emit at least something
        debug!("codegen_unimplemented: {} at {}", operation_name, loc.short_string());
        let body = vec![
            // Assert false to alert the user that there is a path that uses an unimplemented feature.
            Stmt::assert_false(&GotocCtx::unsupported_msg(operation_name, Some(url)), loc.clone()),
            // Assume false to block any further exploration of this path.
            Stmt::assume(Expr::bool_false(), loc.clone()),
            t.nondet().as_stmt(loc.clone()).with_location(loc.clone()), //TODO assume rust validity contraints
        ];
        Expr::statement_expression(body, t).with_location(loc)
    }
pub fn codegen_unimplemented ( & mut self , operation_name : & str , t : Type , loc : Location , url : & str , ) -> Expr { // We should possibly upgrade this to a warning in the future, but for now emit at least something debug ! ( " " operation_name loc short_string ( ) ) ; let body = vec ! [ // Assert false to alert the user that there is a path that uses an unimplemented feature. Stmt assert_false ( GotocCtx unsupported_msg ( operation_name Some ( url ) ) loc clone ( ) ) // Assume false to block any further exploration of this path. Stmt assume ( Expr bool_false ( ) loc clone ( ) ) t nondet ( ) as_stmt ( loc clone ( ) ) with_location ( loc clone ( ) ) //TODO assume rust validity contraints ] ; Expr :: statement_expression ( body , t ) . with_location ( loc ) }
Kani does not currently support all MIR constructs.
Kani does not currently support all MIR constructs .
&mut self
operation_name
&str
t
Type
loc
Location
url
&str