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_via

judgment_fn! {
    /// Check whether the where-clause `via` (which is one of the `assumptions` that are in in scope)
    /// can be used to prove `goal` (the thing we are trying to prove).
    ///
    /// This is equivalent to the "elaboration" of the environment that takes place in rustc,
    /// but done lazilly. For example, if you have `where T: Eq` then you can clearly prove `T: Eq`
    /// but you can also prove `T: PartialEq` because `trait Eq: PartialEq`.
    pub fn prove_via(
        _decls: Program,
        env: Env,
        assumptions: Predicates,
        via: Predicate,
        goal: Predicate,
    ) => Constraints {
        /* rules omitted */
    }
}

Source: crates/formality-rust/src/prove/prove_via.rs:9

No applicable rule observed: at least one test exercised this judgment with no matching rule.

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.

predicate-congruence-axiom
LineCoverageSource
27N/A(let (skel_c, parameters_c) = pred_1.debone())
29N/A(let (skel_g, parameters_g) = pred_2.debone())
30✗(if !skel_c.is_relation())
31✗(if skel_c == skel_g)
322(prove(decls, env, assumptions, Predicates::all_eq(parameters_c, parameters_g)) => c)
──────── ("predicate-congruence-axiom")
3416(prove_via(decls, env, assumptions, Predicate::AtomicPredicate(pred_1), Predicate::AtomicPredicate(pred_2)) => c)
relation-axiom
LineCoverageSource
38N/A(let (skel_c, parameters_c) = rel_1.debone())
39N/A(let (skel_g, parameters_g) = rel_2.debone())
40✗(if skel_c.is_relation())
41✗(if skel_c == skel_g)
42✗(if parameters_c == parameters_g)
──────── ("relation-axiom")
448(prove_via(_decls, env, _assumptions, Predicate::AtomicPredicate(rel_1), Predicate::AtomicPredicate(rel_2)) => Constraints::none(env))
forall
LineCoverageSource
49✗(scope(enter_existentially_with_constraints(env, binder) => (env, via1)) with(c)
// Try to prove `T: Trait<?a> == goal`.
(prove_via(decls, env, assumptions, via1, goal) => c))
──────── ("forall")
532(prove_via(decls, env, assumptions, Predicate::ForAll(binder), goal) => c)
implies
LineCoverageSource
59✗(prove_via(decls, env, assumptions, wc_consequence, goal) => c)
61✗(prove_after(decls, c, assumptions, wc_condition) => c)
──────── ("implies")
63✗(prove_via(decls, env, assumptions, Predicate::Implies(wc_condition, wc_consequence), goal) => c)

How to read this page