From 7247fa2964dbf1ac93e7bf36d741013030a91c5e Mon Sep 17 00:00:00 2001 From: Tortar Date: Sat, 3 Aug 2024 22:26:09 +0200 Subject: [PATCH 1/2] Solve piracies and ambiguities --- src/QSymbolicsBase/express.jl | 5 +++++ src/QSymbolicsBase/utils.jl | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/QSymbolicsBase/express.jl b/src/QSymbolicsBase/express.jl index 8fd6466..54031ab 100644 --- a/src/QSymbolicsBase/express.jl +++ b/src/QSymbolicsBase/express.jl @@ -64,6 +64,11 @@ express_nolookup(x, repr::AbstractRepresentation, ::UseAsState) = express_nolook # where the cache is a distribution over possible samples. express_from_cache(cache) = cache +function consistent_representation(regs,idx,state) + reprs = Set([r.reprs[i] for (r,i) in zip(regs,idx)]) + consistent_representation(reprs,state) +end + """Pick a representation that is consistent with given representations and appropriate for the given state.""" function consistent_representation(reprs,state) reprs = Set(reprs) diff --git a/src/QSymbolicsBase/utils.jl b/src/QSymbolicsBase/utils.jl index 5afe9f1..90e140f 100644 --- a/src/QSymbolicsBase/utils.jl +++ b/src/QSymbolicsBase/utils.jl @@ -1,3 +1,4 @@ + function prefactorscalings(xs) terms = [] coeff = 1::Any @@ -45,4 +46,4 @@ function countmap_flatten(samples, flattenhead) end end counts -end \ No newline at end of file +end From 7e74ae3fe4249a20d1761568e5275866a2abb600 Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+Tortar@users.noreply.github.com> Date: Sat, 3 Aug 2024 22:34:18 +0200 Subject: [PATCH 2/2] Update utils.jl --- src/QSymbolicsBase/utils.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/QSymbolicsBase/utils.jl b/src/QSymbolicsBase/utils.jl index 90e140f..6c21ddf 100644 --- a/src/QSymbolicsBase/utils.jl +++ b/src/QSymbolicsBase/utils.jl @@ -1,4 +1,3 @@ - function prefactorscalings(xs) terms = [] coeff = 1::Any