jf_relation/gates/
logic.rsuse super::Gate;
use crate::constants::{GATE_WIDTH, N_MUL_SELECTORS};
use ark_ff::Field;
#[derive(Clone)]
pub struct LogicOrGate;
impl<F> Gate<F> for LogicOrGate
where
F: Field,
{
fn name(&self) -> &'static str {
"Logic OR Gate"
}
fn q_lc(&self) -> [F; GATE_WIDTH] {
[F::one(), F::one(), F::zero(), F::zero()]
}
fn q_mul(&self) -> [F; N_MUL_SELECTORS] {
[-F::one(), F::zero()]
}
fn q_c(&self) -> F {
-F::one()
}
}
#[derive(Clone)]
pub struct LogicOrOutputGate;
impl<F> Gate<F> for LogicOrOutputGate
where
F: Field,
{
fn name(&self) -> &'static str {
"Logic OR Value Gate"
}
fn q_lc(&self) -> [F; GATE_WIDTH] {
[F::one(), F::one(), F::zero(), F::zero()]
}
fn q_mul(&self) -> [F; N_MUL_SELECTORS] {
[-F::one(), F::zero()]
}
fn q_o(&self) -> F {
F::one()
}
}