synthphonia/backward/
simple.rs

1use crate::debg;
2
3use super::{Deducer, Problem};
4
5
6
7#[derive(Debug)]
8/// A structure using a basic deduction strategy for every type `int`, `bool`, etc. 
9pub struct SimpleDeducer {
10    pub nt: usize
11}
12
13impl Deducer for SimpleDeducer {
14    /// Deduces a given `Problem` asynchronously using the `Executor`. 
15    async fn deduce(&'static self, exec: &'static crate::forward::executor::Executor, problem: Problem) -> &'static crate::expr::Expr {
16        debg!("Deducing subproblem: {} {:?}", exec.cfg[self.nt].name, problem.value);
17        let task = exec.data[self.nt].all_eq.acquire(problem.value);
18        task.await
19    }
20}