Skip to content

Commit 44b153f

Browse files
committed
feat(deep_causality_uncertain): Migrated internal compute graph to ConsTree from deep_causality_ast crate.
Signed-off-by: Marvin Hansen <[email protected]>
1 parent 2daefc9 commit 44b153f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1426
-2355
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deep_causality/src/traits/contextuable/datable_uncertain.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
44
*/
55
use crate::Identifiable;
6-
use deep_causality_uncertain::Uncertain;
6+
use deep_causality_uncertain::{ProbabilisticType, Uncertain};
77

88
/// Represents uncertain data entities in a context graph.
99
///
@@ -15,7 +15,10 @@ use deep_causality_uncertain::Uncertain;
1515
/// in how data is modeled. You may wrap sensor input, encoded strings,
1616
/// discrete values, or even external references.
1717
///
18-
pub trait UncertainDatable<T>: Identifiable {
18+
pub trait UncertainDatable<T>: Identifiable
19+
where
20+
T: ProbabilisticType,
21+
{
1922
/// Returns the contained data.
2023
///
2124
/// If `Self::Data` is `Copy`, this will typically return a copy. Otherwise, it may

deep_causality/tests/types/reasoning_types/propagating_effect/display_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ fn test_display() {
2929

3030
let point = Uncertain::<bool>::point(true);
3131
let effect4 = UncertainBool(point);
32-
assert!(format!("{effect4}").contains("Point(true)"));
32+
assert!(format!("{effect4}").contains("Value(Bool(true))"));
3333

3434
let point = Uncertain::<f64>::point(4.0f64);
3535
let effect5 = UncertainFloat(point);
36-
assert!(format!("{effect5}").contains("Point(4.0)"));
36+
assert!(format!("{effect5}").contains("Value(Float(4.0))"));
3737
}

deep_causality_uncertain/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ rust_library(
1313
deps = [
1414
# Internal crates
1515
"//deep_causality_rand",
16-
"//deep_causality_haft",
16+
"//deep_causality_ast",
17+
"//deep_causality_num",
1718
],
1819
)
1920

deep_causality_uncertain/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ path = "examples/sensor/sensor_processing.rs"
4242
[package.metadata.docs.rs]
4343
all-features = true
4444

45-
[dependencies.deep_causality_haft]
46-
path = "../deep_causality_haft"
47-
version = "0.2"
45+
[dependencies.deep_causality_ast]
46+
path = "../deep_causality_ast"
47+
version = "0.1"
4848

4949
[dependencies.deep_causality_num]
5050
path = "../deep_causality_num"

deep_causality_uncertain/src/extensions/hkt_maybe_uncertain/mod.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

deep_causality_uncertain/src/extensions/hkt_uncertain/mod.rs

Lines changed: 0 additions & 63 deletions
This file was deleted.

deep_causality_uncertain/src/extensions/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
* SPDX-License-Identifier: MIT
33
* Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
44
*/
5-
pub(crate) mod hkt_maybe_uncertain;
6-
pub(crate) mod hkt_uncertain;
5+
76
pub(crate) mod probabilistic_type;

deep_causality_uncertain/src/extensions/probabilistic_type/bool_probabilistic_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::{FromSampledValue, IntoSampledValue, ProbabilisticType};
77
use crate::{SampledValue, UncertainError};
88

99
impl IntoSampledValue for bool {
10-
fn into_sampled_value(&self) -> SampledValue {
11-
SampledValue::Bool(*self)
10+
fn into_sampled_value(self) -> SampledValue {
11+
SampledValue::Bool(self)
1212
}
1313
}
1414

deep_causality_uncertain/src/extensions/probabilistic_type/f64_probabilistic_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{SampledValue, UncertainError};
88
use deep_causality_num::ToPrimitive;
99

1010
impl IntoSampledValue for f64 {
11-
fn into_sampled_value(&self) -> SampledValue {
11+
fn into_sampled_value(self) -> SampledValue {
1212
SampledValue::Float(self.to_f64().unwrap_or(f64::NAN))
1313
}
1414
}

0 commit comments

Comments
 (0)