1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! # plonkish-cat
//!
//! A `PLONKish` circuit system built on comp-cat-rs's categorical
//! infrastructure.
//!
//! Circuits form a **symmetric monoidal category** where:
//! - Objects = wire counts
//! - Morphisms = gadgets (constraint-generating sub-circuits)
//! - Composition = sequential wiring
//! - Tensor product = parallel placement
//! - Braiding = wire permutation
//!
//! The free category on the `PLONKish` graph of primitive gates
//! provides the circuit DSL. Paths are composed circuits.
//! The [`compile`] function interprets paths into constraint sets
//! via the universal property of free categories.
//!
//! ## Quick start
//!
//! ```rust
//! use plonkish_cat::*;
//! use field_cat::F101;
//! use comp_cat_rs::collapse::free_category::{Edge, Path};
//!
//! // Build the standard `PLONKish` graph.
//! let graph = PlonkishGraph::<F101>::standard();
//!
//! // Compose: dup (1 -> 2) then mul (2 -> 1) = squaring circuit.
//! let dup = Path::singleton(&graph, Edge::new(3))?;
//! let mul = Path::singleton(&graph, Edge::new(1))?;
//! let square = dup.compose(mul)?;
//!
//! // Compile to constraints.
//! let _constraints = compile(&graph, &square)?;
//! # Ok::<(), plonkish_cat::Error>(())
//! ```
//!
//! The [`Field`](field_cat::Field) trait and the toy
//! [`F101`](field_cat::F101) field used in this example live in
//! the sibling [`field_cat`] crate so they can be shared with
//! STARK-flavored downstreams without inheriting the `PLONKish`
//! constraint vocabulary.
pub use ;
pub use Error;
pub use Expression;
pub use ;
pub use compile;
pub use ;