Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Judgment prove_wf

judgment_fn! {
    pub fn prove_wf(
        _decls: Program,
        env: Env,
        assumptions: Predicates,
        goal: Parameter,
    ) => Constraints {
        /* rules omitted */
    }
}

Source: crates/formality-rust/src/prove/prove_wf.rs:12

The number on each rule’s conclusion is positive coverage; the number on each premise is negative coverage. Click a number to browse the tests.

universal variables
LineCoverageSource
──────── ("universal variables")
29323(prove_wf(_decls, env, _assumptions, UniversalVar { .. }) => Constraints::none(env))
references
LineCoverageSource
34✗(let (lt, ty) = parameters.downcast_err::<(Lt, Ty)>()?)
351(prove_wf_recursive(decls, env, assumptions, ty) => c)
36✗(prove_after(decls, c, assumptions, AtomicPredicate::outlives(ty, lt)) => c)
──────── ("references")
38309(prove_wf(decls, env, assumptions, RigidTy { name: RigidName::Ref(_), parameters }) => c)
raw-pointers
LineCoverageSource
43✗(let (ty,) = parameters.downcast_err::<(Ty,)>()?)
44✗(prove_wf_recursive(decls, env, assumptions, ty) => c)
──────── ("raw-pointers")
46✗(prove_wf(decls, env, assumptions, RigidTy { name: RigidName::Raw(_), parameters }) => c)
tuples
LineCoverageSource
50✗(for_all(decls, env, assumptions, parameters, &prove_wf_recursive) => c)
──────── ("tuples")
52317(prove_wf(decls, env, assumptions, RigidTy { name: RigidName::Tuple(_), parameters }) => c)
integers and booleans
LineCoverageSource
56✗(for_all(decls, env, assumptions, parameters, &prove_wf_recursive) => c)
──────── ("integers and booleans")
58187(prove_wf(decls, env, assumptions, RigidTy { name: RigidName::ScalarId(_), parameters }) => c)
ADT
LineCoverageSource
62✗(for_all(decls, env, assumptions, parameters, &prove_wf_recursive) => c)
63✗(let t = decls.program().adt_item_named(adt_id)?.to_adt())
64N/A(let t = t.binder.instantiate_with(parameters).unwrap())
655(prove_after(decls, c, assumptions, &t.where_clauses) => c)
──────── ("ADT")
6753(prove_wf(decls, env, assumptions, RigidTy { name: RigidName::AdtId(adt_id), parameters }) => c)
static lifetime
LineCoverageSource
──────── ("static lifetime")
724(prove_wf(_decls, env, _assumptions, Lt::Static) => Constraints::none(env))
scalar constants are always wf
LineCoverageSource
──────── ("scalar constants are always wf")
771(prove_wf(_decls, env, _assumptions, Const::Scalar(_)) => Constraints::none(env))
const blocks are wf if they type-check
LineCoverageSource
81✗(borrow_check(TypeckEnv::for_const(env, decls), assumptions, FlowState::default(), block) => ())
──────── ("const blocks are wf if they type-check")
83✗(prove_wf(decls, env, _assumptions, Const::Block(block)) => Constraints::none(env))
aliases
LineCoverageSource
87✗(prove_alias_wf(decls, env, assumptions, name, parameters) => c)
──────── ("aliases")
898(prove_wf(decls, env, assumptions, AliasTy { name, parameters }) => c)

How to read this page