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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! # csw-core
//!
//! Core categorical structures for the Categorical Semantics Workbench.
//!
//! This crate provides the foundational types for specifying categorical structures
//! (products, coproducts, exponentials, tensor products, etc.) and their properties.
//! From these specifications, type systems can be automatically derived using the
//! Curry-Howard-Lambek correspondence.
//!
//! ## Overview
//!
//! The Categorical Semantics Workbench operationalizes the insight that:
//! - **Logic** ↔ **Type Theory** ↔ **Category Theory**
//!
//! Given a categorical structure, we can mechanically derive the corresponding
//! type system, and vice versa.
//!
//! ## Example
//!
//! ```rust
//! use csw_core::CategoryBuilder;
//!
//! // Define a Cartesian Closed Category (CCC)
//! // This will derive the Simply-Typed Lambda Calculus
//! let ccc = CategoryBuilder::new("STLC")
//! .with_base("Int")
//! .with_base("Bool")
//! .with_terminal()
//! .with_products()
//! .with_exponentials()
//! .cartesian()
//! .build()
//! .expect("valid CCC specification");
//! ```
//!
//! ## Categorical Structures and Their Logics
//!
//! | Structure | Logic/Type System |
//! |-----------|-------------------|
//! | Cartesian Closed Category | Simply-typed λ-calculus |
//! | Bicartesian Closed Category | λ-calculus with sums |
//! | Symmetric Monoidal Closed Category | Linear λ-calculus |
//! | Affine Category | Affine types (Rust-like) |
// Placeholder modules for future implementation
pub use *;
pub use *;
pub use *;