Skip to main content

xlog_prob/
lib.rs

1//! Probabilistic reasoning tier for XLOG (Phase 4).
2#![warn(missing_docs)]
3
4mod aggregates;
5#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
6pub mod cnf;
7#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
8pub mod compilation;
9mod decision_order;
10pub mod epistemic;
11pub mod epistemic_production;
12#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
13pub mod exact;
14#[allow(dead_code)] // reserved: GPU-only exact compilation path (not yet wired to main pipeline)
15#[allow(missing_docs)]
16pub mod exact_gpu;
17#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
18pub mod gpu;
19#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
20pub mod kc;
21#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
22pub mod mc;
23#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
24pub mod neural_fast_path;
25#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
26pub mod pir;
27#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
28pub mod provenance;
29#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
30pub mod wfs;
31#[allow(missing_docs)] // TODO(v0.6): document or make pub(crate)
32pub mod xgcf;
33
34#[cfg(all(test, feature = "host-io"))]
35pub(crate) mod test_gpu_lock {
36    use std::sync::{Mutex, MutexGuard, OnceLock};
37
38    pub(crate) fn lock() -> MutexGuard<'static, ()> {
39        static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
40        LOCK.get_or_init(|| Mutex::new(()))
41            .lock()
42            .unwrap_or_else(|poisoned| poisoned.into_inner())
43    }
44}
45
46pub use pir::{ChoiceVarId, LeafId, PirGraph, PirNode, PirNodeId};
47pub use provenance::{
48    AggregateLiftReport, AggregateLiftStatus, ChoiceSource, GroundAtom, Provenance, Value,
49};
50
51// Primary entry points (convenience re-exports)
52pub use compilation::{
53    compile_gpu_d4_and_verify, compile_gpu_d4_and_verify_cached, CircuitCompileProfile,
54    GpuCompileConfig,
55};
56pub use exact::{ExactDdnnfProgram, ExactResult, GpuConfig};
57pub use mc::{
58    EvidenceForcing, ForceabilityReason, McCountStrategy, McDeviceResult, McEvalConfig,
59    McHotLoopTransfers, McProgram, McResult, McSamplingMethod,
60};
61pub use wfs::{
62    evaluate_wfs_rules, evaluate_wfs_with_rules, TruthValue, WfsAtom, WfsConfig, WfsLiteral,
63    WfsResult, WfsRule,
64};