-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Description
#[test]
fn depth_not_on_stack() {
test! {
program {
#[coinductive]
trait A {}
#[coinductive]
trait B {}
#[coinductive]
trait C {}
#[coinductive]
trait D {}
#[coinductive]
trait E {}
impl<T> A for ()
where
T: B,
{}
impl<T> A for ()
where
T: E
{}
impl<T> B for ()
where
T: C,
T: E,
{}
impl<T> C for ()
where
T: D,
T: B,
{}
impl<T> D for ()
where
T: C
{}
impl<T> E for ()
where
T: D
{}
}
goal {
exists<T> {
T: A
}
} yields[SolverChoice::slg(10, None)] {
expect![["Unique; for<?U0> { substitution [?0 := ^0.0] }"]]
} yields[SolverChoice::recursive_default()] {
expect![["Unique; for<?U0> { substitution [?0 := ^0.0] }"]]
}
}
}results in
--- test::cycle::depth_not_on_stack stdout ----
program {
#[coinductive] trait A {} #[coinductive] trait B {} #[coinductive] trait C
{} #[coinductive] trait D {} #[coinductive] trait E {} impl < T > A for()
where T : B, {} impl < T > A for() where T : E {} impl < T > B for() where
T : C, T : E, {} impl < T > C for() where T : D, T : B, {} impl < T > D
for() where T : C {} impl < T > E for() where T : D {}
}
thread 'test::cycle::depth_not_on_stack' panicked at 'Negative subgoal had delayed_subgoals', /home/lcnr/chalk/chalk-engine/src/logic.rs:725:21
Found this while trying to get a test for the following buggy proof tree:
- A
- candidate 1:
- B
- C
- D (d has depth 2)
- C
- B (depth 0)
- D (d has depth 2)
- E
- D (from cache with depth 2, even though the depth should be 0)
- ok (incorrectly moved to global cache)
- FALSE
- C
- B
- candidate 2:
- E (ok)
- candidate 1:
Metadata
Metadata
Assignees
Labels
No labels