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

Positive coverage: prove_normalize / normalize-via-assumption

normalize-via-assumption
LineCoverageSource
32(a in assumptions)
339(prove_normalize_via(decls, env, assumptions, a, goal) => c)
──────── ("normalize-via-assumption")
353(prove_normalize(decls, env, assumptions, goal) => c)

3 tests exercised this rule:


Source location: crates/formality-rust/src/prove/prove/test/eq_assumptions.rs:15

#[test]
fn test_a() {
    test_prove(
        Program::empty(),
        term("{} => {for<T, U> if {T = u32, U = Vec<T>} U = Vec<u32>}"),
    )
    .assert_ok(expect!["{Constraints { env: Env { variables: [], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {} }}"]);
}
Proof tree

Source location: crates/formality-rust/src/prove/prove/test/eq_assumptions.rs:24

#[test]
fn test_b() {
    test_prove(
        Program::empty(),
        term("exists<A> {} => {for<T, U> if {T = u32, U = Vec<T>} A = U}"),
    )
    .assert_ok(expect!["{Constraints { env: Env { variables: [?ty_2, ?ty_1], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {?ty_1 => Vec<u32>, ?ty_2 => u32} }}"]);
}
Proof tree

Source location: crates/formality-rust/src/prove/prove/test/eq_assumptions.rs:126

#[test]
fn test_normalize_assoc_ty_existential1() {
    test_prove(
        Program::empty(),
        term(
            "\
            forall<T> \
            exists<A> \
            { <T as Iterator>::Item = u32 } => { <A as Iterator>::Item = u32 }",
        ),
    )
    .assert_ok(expect!["{Constraints { env: Env { variables: [!ty_1, ?ty_2], bias: Soundness, pending: [], allow_pending_outlives: false }, known_true: true, substitution: {?ty_2 => !ty_1} }}"]);
}
Proof tree