Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
714 changes: 712 additions & 2 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.1.0"
version = "0.2.0"
authors = ["Daniel Dominguez (Veridise) <daniel@veridise.com>"]
edition = "2024"
rust-version = "1.85"
Expand All @@ -16,4 +16,8 @@ license-file = "LICENSE"
[workspace.dependencies]
ff = "0.13"
thiserror = "2.0"
internment = "0.8.6"
num-bigint = "0.4"
log = "0.4"
eqv = "0.1"

15 changes: 14 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ repository = {workspace = true}
license-file = {workspace = true}

[dependencies]
ff.workspace = true
ff.workspace = true
thiserror.workspace = true
eqv.workspace = true
internment.workspace = true
num-bigint.workspace = true
log.workspace = true


[dev-dependencies]
simplelog = {version = "0.12", features = ["test"] }
similar-asserts = "1.7"
quickcheck = "1"
quickcheck_macros = "1"
ff = { workspace = true, features = ["derive"] }
halo2curves = "0.9"

35 changes: 35 additions & 0 deletions core/src/cmp.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//! Comparison IR operator.

/// Comparison operators between arithmetic expressions.
#[derive(Copy, Clone, PartialEq, Eq, Debug, PartialOrd, Ord, Hash)]
pub enum CmpOp {
/// Equality
Eq,
/// Less than
Lt,
/// Less than or equal
Le,
/// Greater than
Gt,
/// Greater than or equal
Ge,
/// Not equal
Ne,
}

impl std::fmt::Display for CmpOp {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
CmpOp::Eq => "==",
CmpOp::Lt => "<",
CmpOp::Le => "<=",
CmpOp::Gt => ">",
CmpOp::Ge => ">=",
CmpOp::Ne => "!=",
}
)
}
}
13 changes: 13 additions & 0 deletions core/src/eqv.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Types and traits related to equivalence relations.
//!
//! Re-exports the [`eqv`] crate for convenience.

pub use ::eqv::*;

/// Symbolic equivalence relation.
///
/// Symbolic in this context means that when comparing
/// entities information that does not affect the semantics
/// of what the entities are expression is ignored.
#[derive(Debug)]
pub struct SymbolicEqv;
17 changes: 7 additions & 10 deletions core/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
//! Error type.

use crate::table::Any;
use crate::{slot::cell::CellError, table::TableError};
use thiserror::Error;

/// Core error type.
#[derive(Error, Copy, Clone, Debug)]
pub enum Error {
/// Unexpected column type when Fixed was expected.
#[error("Expected Any::Fixed. Got {0:?}")]
ExpectedFixed(Any),
/// Unexpected column type when Advice was expected.
#[error("Expected Any::Advice. Got {0:?}")]
ExpectedAdvice(Any),
/// Unexpected column type when Instance was expected.
#[error("Expected Any::Instance. Got {0:?}")]
ExpectedInstance(Any),
/// Error related to the PLONK table.
#[error(transparent)]
TableError(#[from] TableError),
/// Error related to cell references.
#[error(transparent)]
CellRefError(#[from] CellError),
}
Loading