compiled-knowledge 4.0.0a22__cp312-cp312-macosx_11_0_arm64.whl → 4.0.0a24__cp312-cp312-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of compiled-knowledge might be problematic. Click here for more details.

Files changed (33) hide show
  1. ck/circuit/_circuit_cy.c +50 -60
  2. ck/circuit/_circuit_cy.cpython-312-darwin.so +0 -0
  3. ck/circuit/_circuit_cy.pyx +1 -1
  4. ck/circuit/_circuit_py.py +1 -1
  5. ck/circuit_compiler/circuit_compiler.py +3 -2
  6. ck/circuit_compiler/cython_vm_compiler/_compiler.c +179 -170
  7. ck/circuit_compiler/cython_vm_compiler/_compiler.cpython-312-darwin.so +0 -0
  8. ck/circuit_compiler/cython_vm_compiler/_compiler.pyx +3 -3
  9. ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py +14 -7
  10. ck/circuit_compiler/interpret_compiler.py +35 -4
  11. ck/circuit_compiler/llvm_vm_compiler.py +9 -3
  12. ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c +1 -1
  13. ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.cpython-312-darwin.so +0 -0
  14. ck/circuit_compiler/support/llvm_ir_function.py +18 -1
  15. ck/pgm.py +100 -102
  16. ck/pgm_compiler/pgm_compiler.py +1 -1
  17. ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c +1 -1
  18. ck/pgm_compiler/support/circuit_table/_circuit_table_cy.cpython-312-darwin.so +0 -0
  19. ck/pgm_compiler/support/join_tree.py +3 -3
  20. ck/probability/empirical_probability_space.py +4 -3
  21. ck/probability/pgm_probability_space.py +7 -3
  22. ck/probability/probability_space.py +21 -15
  23. ck/program/raw_program.py +40 -7
  24. ck/sampling/sampler_support.py +8 -5
  25. ck_demos/ace/simple_ace_demo.py +18 -0
  26. ck_demos/getting_started/__init__.py +0 -0
  27. ck_demos/getting_started/simple_demo.py +18 -0
  28. ck_demos/programs/demo_raw_program_dump.py +17 -0
  29. {compiled_knowledge-4.0.0a22.dist-info → compiled_knowledge-4.0.0a24.dist-info}/METADATA +1 -1
  30. {compiled_knowledge-4.0.0a22.dist-info → compiled_knowledge-4.0.0a24.dist-info}/RECORD +33 -29
  31. {compiled_knowledge-4.0.0a22.dist-info → compiled_knowledge-4.0.0a24.dist-info}/WHEEL +0 -0
  32. {compiled_knowledge-4.0.0a22.dist-info → compiled_knowledge-4.0.0a24.dist-info}/licenses/LICENSE.txt +0 -0
  33. {compiled_knowledge-4.0.0a22.dist-info → compiled_knowledge-4.0.0a24.dist-info}/top_level.txt +0 -0
@@ -15,7 +15,7 @@
15
15
  "-O3"
16
16
  ],
17
17
  "include_dirs": [
18
- "/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-8d_gezt7/lib/python3.12/site-packages/numpy/_core/include"
18
+ "/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-gdy6g4em/lib/python3.12/site-packages/numpy/_core/include"
19
19
  ],
20
20
  "name": "ck.pgm_compiler.support.circuit_table._circuit_table_cy",
21
21
  "sources": [
@@ -192,7 +192,7 @@ def _make_spanning_tree_small_root(cost: NDArrayFloat64, clusters: List[Set[int]
192
192
  Returns:
193
193
  (spanning_tree, root_index)
194
194
 
195
- spanning_tree: is a spanning tree represented as a list of nodes, the list is coindexed with
195
+ spanning_tree: is a spanning tree represented as a list of nodes, the list is co-indexed with
196
196
  the given cost matrix, each node is a list of children, each child being
197
197
  represented as an index into the list of nodes.
198
198
 
@@ -219,7 +219,7 @@ def _make_spanning_tree_arbitrary_root(cost: NDArrayFloat64) -> Tuple[List[List[
219
219
  Returns:
220
220
  (spanning_tree, root_index)
221
221
 
222
- spanning_tree: is a spanning tree represented as a list of nodes, the list is coindexed with
222
+ spanning_tree: is a spanning tree represented as a list of nodes, the list is co-indexed with
223
223
  the given cost matrix, each node is a list of children, each child being
224
224
  represented as an index into the list of nodes.
225
225
 
@@ -243,7 +243,7 @@ def _make_spanning_tree_at_root(
243
243
  root_custer_index: a nominated root cluster to be the root of the tree.
244
244
 
245
245
  Returns:
246
- a spanning tree represented as a list of nodes, the list is coindexed with
246
+ a spanning tree represented as a list of nodes, the list is co-indexed with
247
247
  the given cost matrix, each node is a list of children, each child being
248
248
  represented as an index into the list of nodes. The root node is the
249
249
  index `root_custer_index` as passed to this function.
@@ -1,4 +1,4 @@
1
- from typing import Sequence, Iterable, Tuple, Dict, List
1
+ from typing import Sequence, Iterable, Tuple, Dict
2
2
 
3
3
  from ck.pgm import RandomVariable, Indicator, Instance
4
4
  from ck.probability.probability_space import ProbabilitySpace, Condition, check_condition
@@ -10,6 +10,8 @@ class EmpiricalProbabilitySpace(ProbabilitySpace):
10
10
  Enable probabilistic queries over a sample from a sample space.
11
11
  Note that this is not necessarily an efficient approach to calculating probabilities and statistics.
12
12
 
13
+ This probability space treats each of the samples as equally weighted.
14
+
13
15
  Assumes:
14
16
  len(sample) == len(rvs), for each sample in samples.
15
17
  0 <= sample[i] < len(rvs[i]), for each sample in samples, for i in range(len(rvs)).
@@ -19,7 +21,7 @@ class EmpiricalProbabilitySpace(ProbabilitySpace):
19
21
  samples: instances (state indexes) that are samples from the given rvs.
20
22
  """
21
23
  self._rvs: Sequence[RandomVariable] = tuple(rvs)
22
- self._samples: List[Instance] = list(samples)
24
+ self._samples: Sequence[Instance] = tuple(samples)
23
25
  self._rv_idx_to_sample_idx: Dict[int, int] = {
24
26
  rv.idx: i
25
27
  for i, rv in enumerate(self._rvs)
@@ -47,4 +49,3 @@ class EmpiricalProbabilitySpace(ProbabilitySpace):
47
49
  @property
48
50
  def z(self) -> float:
49
51
  return len(self._samples)
50
-
@@ -1,6 +1,6 @@
1
- from typing import Sequence, Iterable, Tuple, Dict, List
1
+ from typing import Sequence, Tuple
2
2
 
3
- from ck.pgm import RandomVariable, Indicator, Instance, PGM
3
+ from ck.pgm import RandomVariable, Indicator, PGM
4
4
  from ck.probability.probability_space import ProbabilitySpace, Condition, check_condition
5
5
 
6
6
 
@@ -12,6 +12,11 @@ class PGMProbabilitySpace(ProbabilitySpace):
12
12
 
13
13
  Args:
14
14
  pgm: The PGM to query.
15
+
16
+ Warning:
17
+ The resulting probability space assumes that the value of the partition
18
+ function, `z`, remains constant for the lifetime of the PGM. If the value
19
+ changes, then probabilities and statistics will be incorrect.
15
20
  """
16
21
  self._pgm = pgm
17
22
  self._z = None
@@ -29,4 +34,3 @@ class PGMProbabilitySpace(ProbabilitySpace):
29
34
  if self._z is None:
30
35
  self._z = self._pgm.value_product_indicators()
31
36
  return self._z
32
-
@@ -1,10 +1,7 @@
1
- """
2
- An abstract class for object providing probabilities.
3
- """
4
1
  import math
5
2
  from abc import ABC, abstractmethod
6
3
  from itertools import chain
7
- from typing import Sequence, Tuple, Iterable, Callable
4
+ from typing import Sequence, Tuple, Iterable, Callable, TypeAlias
8
5
 
9
6
  import numpy as np
10
7
 
@@ -13,8 +10,20 @@ from ck.utils.iter_extras import combos as _combos
13
10
  from ck.utils.map_set import MapSet
14
11
  from ck.utils.np_extras import dtype_for_number_of_states, NDArrayFloat64, DTypeStates, NDArrayNumeric
15
12
 
16
- # Type defining a condition.
17
- Condition = None | Indicator | Iterable[Indicator]
13
+ Condition: TypeAlias = None | Indicator | Iterable[Indicator]
14
+ Condition.__doc__ = \
15
+ """
16
+ Type defining a condition. A condition is logically a set of
17
+ indicators, each indicator representing a random variable being in some state.
18
+
19
+ If multiple indicators of the same random variable appear in
20
+ a condition, then they are interpreted as
21
+ a disjunction, otherwise indicators are interpreted as
22
+ a conjunction. E.g., the condition (X=0, Y=1, Y=3) means
23
+ X=0 and (Y=1 or Y=3).
24
+ """
25
+
26
+ _NAN: float = np.nan # Not-a-number (i.e., the result of an invalid calculation).
18
27
 
19
28
 
20
29
  class ProbabilitySpace(ABC):
@@ -41,13 +50,9 @@ class ProbabilitySpace(ABC):
41
50
  """
42
51
  Return the weight of instances matching the given condition.
43
52
 
44
- If multiple indicators of the same random variable appear in
45
- the parameter 'indicators' then they are interpreted as
46
- a disjunction, otherwise indicators are interpreted as
47
- a conjunction. E.g.: X=0, Y=1, Y=3 means X=0 and (Y=1 or Y=3)
48
-
49
53
  Args:
50
- condition: zero or more indicators that specify a condition.
54
+ condition: a condition restricting the instances that are
55
+ considered in the result.
51
56
  """
52
57
 
53
58
  @property
@@ -56,6 +61,7 @@ class ProbabilitySpace(ABC):
56
61
  """
57
62
  Return the summed weight of all instances.
58
63
  This is equivalent to self.wmc(), with no arguments.
64
+ This is also known as the "partition function".
59
65
  """
60
66
 
61
67
  def probability(self, *indicators: Indicator, condition: Condition = ()) -> float:
@@ -80,11 +86,11 @@ class ProbabilitySpace(ABC):
80
86
  if len(condition) == 0:
81
87
  z = self.z
82
88
  if z <= 0:
83
- return np.nan
89
+ return _NAN
84
90
  else:
85
91
  z = self.wmc(*condition)
86
92
  if z <= 0:
87
- return np.nan
93
+ return _NAN
88
94
 
89
95
  # Combine the indicators with the condition
90
96
  # If a variable is mentioned in both the indicators and condition, then
@@ -617,6 +623,6 @@ def _normalise_marginal(distribution: NDArrayFloat64) -> None:
617
623
  """
618
624
  total = np.sum(distribution)
619
625
  if total <= 0:
620
- distribution[:] = np.nan
626
+ distribution[:] = _NAN
621
627
  elif total != 1:
622
628
  distribution /= total
ck/program/raw_program.py CHANGED
@@ -21,7 +21,11 @@ class RawProgram:
21
21
  A raw program is returned by a circuit compiler to provide execution of
22
22
  the function defined by a compiled circuit.
23
23
 
24
- A `RawProgram` is a `Callable` with the signature:
24
+ A `RawProgram` is a `Callable`; given an array of input variable values,
25
+ return a numpy array of result values. Calling a RawProgram is not necessarily
26
+ an efficient method for executing a program as buffers are reallocated for
27
+ each call. Alternatively, a `RawProgram` can be wrapped in a `ProgramBuffer`
28
+ for computationally efficient memory buffer reuse.
25
29
 
26
30
  Fields:
27
31
  function: is a function of three ctypes arrays, returning nothing.
@@ -40,19 +44,33 @@ class RawProgram:
40
44
  number_of_results: int
41
45
  var_indices: Sequence[int]
42
46
 
43
- def __call__(self, in_vars: NDArrayNumeric | Sequence[int | float]) -> NDArrayNumeric:
47
+ def __call__(self, var_values: NDArrayNumeric | Sequence[int | float] | int | float) -> NDArrayNumeric:
44
48
  """
45
- Call the raw program as a function from an array to an array.
49
+ Call the raw program as a function. This method will allocate numpy arrays of type `self.dtype`
50
+ for input, temporary, and output values. If `var_values` is a numpy array of the needed
51
+ dtype then it will be used directly.
52
+
53
+ Args:
54
+ var_values: the input variable values. This can be a numpy array, a Python sequence of
55
+ floats or int, or a single float or int. The number of input values must equal
56
+ `self.number_of_vars`.
57
+
58
+ Returns:
59
+ a numpy array of result values with shape `(self.number_of_results,)`.
46
60
  """
47
61
  array_vars: NDArrayNumeric
48
62
  if isinstance(vars, np.ndarray):
49
- array_vars = in_vars
63
+ if var_values.dtype != self.dtype:
64
+ array_vars = var_values.astype(self.dtype)
65
+ else:
66
+ array_vars = self.dtype
67
+ elif isinstance(vars, (int, float)):
68
+ array_vars = np.array([var_values], dtype=self.dtype)
50
69
  else:
51
- array_vars = np.array(in_vars, dtype=self.dtype)
70
+ array_vars = np.array(var_values, dtype=self.dtype)
71
+
52
72
  if array_vars.shape != (self.number_of_vars,):
53
73
  raise ValueError(f'input array incorrect shape: got {array_vars.shape} expected ({self.number_of_vars},)')
54
- if array_vars.dtype != self.dtype:
55
- raise ValueError(f'input array incorrect dtype: got {array_vars.dtype} expected {self.dtype}')
56
74
 
57
75
  array_tmps: NDArrayNumeric = np.zeros(self.number_of_tmps, dtype=self.dtype)
58
76
  array_outs: NDArrayNumeric = np.zeros(self.number_of_results, dtype=self.dtype)
@@ -64,3 +82,18 @@ class RawProgram:
64
82
 
65
83
  self.function(c_array_vars, c_array_tmps, c_array_outs)
66
84
  return array_outs
85
+
86
+ def dump(self, *, prefix: str = '', indent: str = ' ') -> None:
87
+ """
88
+ Print a dump of the PGM.
89
+ This is intended for demonstration and debugging purposes.
90
+
91
+ Args:
92
+ prefix: optional prefix for indenting all lines.
93
+ indent: additional prefix to use for extra indentation.
94
+ """
95
+ print(f'{prefix}{self.__class__.__name__}')
96
+ print(f'{prefix}signature = [{self.number_of_vars}] -> [{self.number_of_results}]')
97
+ print(f'{prefix}temps = {self.number_of_tmps}')
98
+ print(f'{prefix}dtype = {self.dtype}')
99
+ print(f'{prefix}var_indices = {self.var_indices}')
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass
2
2
  from itertools import count
3
- from typing import Callable, Sequence, Optional, Set, Tuple, Dict, Collection
3
+ from typing import Callable, Sequence, Optional, Set, Tuple, Dict, Collection, TypeAlias
4
4
 
5
5
  from ck.pgm import Instance, RandomVariable, Indicator
6
6
  from ck.pgm_circuit.program_with_slotmap import ProgramWithSlotmap
@@ -10,10 +10,13 @@ from ck.utils.map_set import MapSet
10
10
  from ck.utils.np_extras import NDArrayStates, NDArrayNumeric
11
11
  from ck.utils.random_extras import Random
12
12
 
13
- # Type of a yield function. Support for a sampler.
14
- # A yield function may be used to implement a sampler's iterator, thus
15
- # it provides an Instance or single state index.
16
- YieldF = Callable[[NDArrayStates], int] | Callable[[NDArrayStates], Instance]
13
+ YieldF: TypeAlias = Callable[[NDArrayStates], int] | Callable[[NDArrayStates], Instance]
14
+ YieldF.__doc__ = \
15
+ """
16
+ Type of a yield function. Support for a sampler.
17
+ A yield function may be used to implement a sampler's iterator, thus
18
+ it provides an Instance or single state index.
19
+ """
17
20
 
18
21
 
19
22
  @dataclass
@@ -0,0 +1,18 @@
1
+ from ck import example
2
+ from ck.pgm import RVMap
3
+ from ck.pgm_circuit.wmc_program import WMCProgram
4
+ from ck.pgm_compiler import NamedPGMCompiler
5
+
6
+ # create the example "Cancer" Bayesian network
7
+ pgm = example.Cancer()
8
+
9
+ # compile the PGM and construct an object for probabilistic queries
10
+ wmc = WMCProgram(NamedPGMCompiler.ACE(pgm))
11
+
12
+ # provide easy access to the random variables - not needed but simplifies this demo
13
+ rvs = RVMap(pgm)
14
+
15
+ # get the probability of having cancer given that pollution is high
16
+ pr = wmc.probability(rvs.cancer('True'), condition=rvs.pollution('high'))
17
+
18
+ print('probability of having cancer given that pollution is high =', pr)
File without changes
@@ -0,0 +1,18 @@
1
+ from ck import example
2
+ from ck.pgm import RVMap
3
+ from ck.pgm_circuit.wmc_program import WMCProgram
4
+ from ck.pgm_compiler import DEFAULT_PGM_COMPILER
5
+
6
+ # create the example "Cancer" Bayesian network
7
+ pgm = example.Cancer()
8
+
9
+ # compile the PGM and construct an object for probabilistic queries
10
+ wmc = WMCProgram(DEFAULT_PGM_COMPILER(pgm))
11
+
12
+ # provide easy access to the random variables - not needed but simplifies this demo
13
+ rvs = RVMap(pgm)
14
+
15
+ # get the probability of having cancer given that pollution is high
16
+ pr = wmc.probability(rvs.cancer('True'), condition=rvs.pollution('high'))
17
+
18
+ print('probability of having cancer given that pollution is high =', pr)
@@ -0,0 +1,17 @@
1
+ from ck.circuit import Circuit
2
+ from ck.circuit_compiler import NamedCircuitCompiler
3
+
4
+
5
+ def main() -> None:
6
+ cct = Circuit()
7
+ a, b, c, d = cct.new_vars(4)
8
+ top = a * b + c * d + 56.23
9
+
10
+ for compiler in NamedCircuitCompiler:
11
+ raw_program = compiler(top)
12
+ raw_program.dump()
13
+ print()
14
+
15
+
16
+ if __name__ == '__main__':
17
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compiled-knowledge
3
- Version: 4.0.0a22
3
+ Version: 4.0.0a24
4
4
  Summary: A Python package for compiling and querying discrete probabilistic graphical models.
5
5
  Author-email: Barry Drake <barry@compiledknowledge.org>
6
6
  License-Expression: MIT
@@ -16,6 +16,7 @@ ck_demos/utils/compare.py,sha256=bJ8WTLJ0DRe7k9B7E2KD75IlWWBf6aSq7VRhYQjSmb0,496
16
16
  ck_demos/programs/demo_program_none.py,sha256=Qjrk_gzRi4TtBlszqgaDwn0q5Kd9eZnbOY7MKImLEDs,461
17
17
  ck_demos/programs/demo_program_buffer.py,sha256=DxlzFVuE7U2XJeb5LtFmDW3kix3I1a1dowvT-XfjAm4,626
18
18
  ck_demos/programs/demo_program_multi.py,sha256=iWqhN6g9Yfinkb6m9pHuh-sN4pJlCUcb93TPdTJJfN8,600
19
+ ck_demos/programs/demo_raw_program_dump.py,sha256=Zx3LH84IndSSnvoMH0VnCbpwjCvukpKSlSjtaC6XLQ0,353
19
20
  ck_demos/programs/demo_raw_program_llvm.py,sha256=ktUUMi5_wEWdrWf6Sz9U2JpmHPVijX-eiyS5hl-W9gM,502
20
21
  ck_demos/programs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
22
  ck_demos/programs/demo_raw_program_interpreted.py,sha256=__zHAcaxCJ_EFqgfa8C0gatvjzH-clKGMwdN9KbyNxQ,507
@@ -38,6 +39,7 @@ ck_demos/circuit_compiler/show_llvm_program.py,sha256=tlL3TRScb_Mqc-Mbj0M2-WCSPS
38
39
  ck_demos/ace/demo_ace.py,sha256=wsWETo1r2GG86Mzo2VD4J1TZiVlvYjVC5A-WMs-zcsw,1409
39
40
  ck_demos/ace/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
41
  ck_demos/ace/copy_ace_to_ck.py,sha256=t0Wg1-8_f9YPlEbBp-YGJ0N3u7a3ZIqcI70MOeV5Kgo,288
42
+ ck_demos/ace/simple_ace_demo.py,sha256=VqvudQfvlYqgLZTKGAfuhBQt5U_vkBuhKT7LuonEN3w,646
41
43
  ck_demos/pgm/show_examples.py,sha256=-35_E9psOX16VvqArZUr9uoUYD6_AmiE3nLEny9REes,436
42
44
  ck_demos/pgm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
45
  ck_demos/pgm/demo_pgm_dump_stress.py,sha256=urWeg4K7Fe718mPybN7gcWLbfcQt9XxgetwWUOmDmLc,267
@@ -48,12 +50,14 @@ ck_demos/pgm_inference/demo_inferencing_wmc_student.py,sha256=R2dajAh4-bb9YFWhQr
48
50
  ck_demos/pgm_inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
51
  ck_demos/pgm_inference/demo_inferencing_mpe_cancer.py,sha256=hS9U2kyqjFgJ8jnVBtT3Tk6qCTkuknNiTlImMejV_6A,1554
50
52
  ck_demos/pgm_inference/demo_inferencing_wmc_and_mpe_sprinkler.py,sha256=-q4Z1Fzf7-BuwVFTFXdGRY-zUNrY-SAU7ooaov2o_lM,5128
51
- compiled_knowledge-4.0.0a22.dist-info/RECORD,,
52
- compiled_knowledge-4.0.0a22.dist-info/WHEEL,sha256=V1loQ6TpxABu1APUg0MoTRBOzSKT5xVc3skizX-ovCU,136
53
- compiled_knowledge-4.0.0a22.dist-info/top_level.txt,sha256=Cf8DAfd2vcnLiA7HlxoduOzV0Q-8surE3kzX8P9qdks,12
54
- compiled_knowledge-4.0.0a22.dist-info/METADATA,sha256=SBeD1euhwu4b1MT7eVLdrS9F3eEkOiCemxxTwthgkWc,1788
55
- compiled_knowledge-4.0.0a22.dist-info/licenses/LICENSE.txt,sha256=-LmkmqXKYojmS3zDxXAeTbsA82fnHA0KaRvpfIoEdjA,1068
56
- ck/pgm.py,sha256=T7ZXWEgn93uh8mf-FxOgkPY8RgabBCUg2lpKoQmhGMU,117226
53
+ ck_demos/getting_started/simple_demo.py,sha256=hiYscNnfkEwHCQ3ymXAswAYO5jAKR7cseb36pjzuus8,650
54
+ ck_demos/getting_started/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ compiled_knowledge-4.0.0a24.dist-info/RECORD,,
56
+ compiled_knowledge-4.0.0a24.dist-info/WHEEL,sha256=V1loQ6TpxABu1APUg0MoTRBOzSKT5xVc3skizX-ovCU,136
57
+ compiled_knowledge-4.0.0a24.dist-info/top_level.txt,sha256=Cf8DAfd2vcnLiA7HlxoduOzV0Q-8surE3kzX8P9qdks,12
58
+ compiled_knowledge-4.0.0a24.dist-info/METADATA,sha256=L0xinlE8t7EAHnNAO-y3Tqjs3jq_H5l0R1RxUgmPpyU,1788
59
+ compiled_knowledge-4.0.0a24.dist-info/licenses/LICENSE.txt,sha256=-LmkmqXKYojmS3zDxXAeTbsA82fnHA0KaRvpfIoEdjA,1068
60
+ ck/pgm.py,sha256=px-eAq-2m3SJ6-eDcuVk9QY8rJE03ZGGWfGnbN-wn0s,117355
57
61
  ck/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
62
  ck/pgm_circuit/target_marginals_program.py,sha256=qWz9FkAFzt8YHLZJzPkpRnvDH76BXm-dcEWhoqCkrOw,3665
59
63
  ck/pgm_circuit/slot_map.py,sha256=pqN0t5ElmUjR7SzvzldQwnO-jjRIz1rNZHH1PzE-V88,822
@@ -65,10 +69,10 @@ ck/pgm_circuit/wmc_program.py,sha256=Btq7jUot-PodWXrgDFaE6zhUtr6GPUNF217CVLTaB70
65
69
  ck/pgm_circuit/pgm_circuit.py,sha256=VBgHk7uDNYiElesEQxdmlU2iRn0bfHYWik2Cb6t838g,3208
66
70
  ck/pgm_circuit/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
71
  ck/pgm_circuit/support/compile_circuit.py,sha256=56KsI01Ww3gSHnqoTt81kzdHgbFTmHwVeB3jEajipHs,3179
68
- ck/probability/probability_space.py,sha256=gjH8la8ZGegWTYetpY16XdbwqEniqy-CiqoDFWRLzkM,25260
69
- ck/probability/pgm_probability_space.py,sha256=o-IVo-PfM-Qu1BZ8xatpFhmaa7SZztnck569FHSdTNo,1002
72
+ ck/probability/probability_space.py,sha256=f82dRyUoyusj0t4-H11mN8j0r2dN-5M6z5RV2SF0E-g,25544
73
+ ck/probability/pgm_probability_space.py,sha256=9al9sZk2LGvnTITvxS8x_ntabHKhaliUW-6JUeAEEl4,1231
70
74
  ck/probability/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
- ck/probability/empirical_probability_space.py,sha256=839eEJi9AW4U9KGzAo-_K-4Ae2M5tdijzMvbYPCO9c0,1900
75
+ ck/probability/empirical_probability_space.py,sha256=ojEMLKVy9Qf-Vi803B9KWARCySIWwf4rt23--mpAxD0,1978
72
76
  ck/example/survey.py,sha256=ubjM8EP7aQMQbx7XFMaXvSYBOPuUDHeyG6wZIlRDqD8,1565
73
77
  ck/example/pathfinder.py,sha256=rQckvasnbzBYYESxngE_xbhyXxoJlELeiYc6Ghh7iFk,2257125
74
78
  ck/example/run.py,sha256=nYfC_prwCRBN0uawLvrRVsl5IFag9VrQ5x_hhWmr-18,964
@@ -100,16 +104,16 @@ ck/example/sprinkler.py,sha256=t8RIiPorf3QXYyTXbxFkSrK1SsG5ALWmTfTsFUq2C_c,938
100
104
  ck/example/diamond_square.py,sha256=HqGqmInYTpAsCBuz3s8FuhT2Jnc11L3wGCTgJDmFLjw,2722
101
105
  ck/example/rain.py,sha256=kLTU_9f_-_yy0ymPnS9-cbFVT6fYyCanDgszk3vQOgc,1187
102
106
  ck/example/cancer.py,sha256=-FnLbfb9yxriLl97N5BDZ0VrDZ5UnOWlT-Ep_tzO6QI,1698
103
- ck/circuit/_circuit_cy.c,sha256=q3PGZPxqinSb59a1oLG7vTCwlbkZ1fOz8Wj7oZkgGaI,1704940
104
- ck/circuit/_circuit_cy.pyx,sha256=PloIztVKt8Fj_2DlATqjm8ZcZar6ozCkLazEYsH4dHE,27005
107
+ ck/circuit/_circuit_cy.c,sha256=Qc4AXKFu7Q89eQN-MT5_K2O7hmmRSayF4p5BII1QAvU,1704292
108
+ ck/circuit/_circuit_cy.pyx,sha256=mER1HK5yyf4UAj9ibn7fUQNyXwoxwxp7PClULPhY9B4,26995
105
109
  ck/circuit/__init__.py,sha256=B1jwDE_Xb6hOQE8DecjaTVotOnDxJaT7jsvPfGDXqCU,401
106
110
  ck/circuit/_circuit_cy.pxd,sha256=ZcW8xjw4oGQqD5gwz73GXc1H8NxpdAswFWzc2CUWWcA,1025
107
- ck/circuit/_circuit_py.py,sha256=4pPHnkXFczk-ea2OeBSc_bLppMyprDkeeQMwp4MCrVo,27505
111
+ ck/circuit/_circuit_py.py,sha256=hADjCFDC1LJKUdyiKZzNLFt7ZkUNJ0IYwEYRj594K4g,27495
108
112
  ck/circuit/tmp_const.py,sha256=wgi4P3xrTRLPXNMmWYpYaJWlm-lekQOdxg4rkXZC3Wk,2298
109
- ck/circuit/_circuit_cy.cpython-312-darwin.so,sha256=u_tDmy8x35RUDePbmz4zNKH0zopS3CQlPKuXQWqaZd4,335344
113
+ ck/circuit/_circuit_cy.cpython-312-darwin.so,sha256=VOnUYrgCohqYvrjsv1TYvl7gTaPzTqMu6DYCiU14yjo,335296
110
114
  ck/sampling/wmc_metropolis_sampler.py,sha256=jfXb-MG0jAoMyepgq9zel2amqK-gmYrCtKuxJStl8VY,6305
111
115
  ck/sampling/wmc_direct_sampler.py,sha256=Pkv-u4GjN3npBrcQ92raoTrEIel1vpiDoE8LrlcfYJE,7094
112
- ck/sampling/sampler_support.py,sha256=SQytIhr3qlIcNjYu9cF7sAxhjiXFLlCwPlsMIOJVH1c,9510
116
+ ck/sampling/sampler_support.py,sha256=ACOn4G2djon5Yna4nZw4J7xeTuPvBYW2Ucal3uf7pjA,9573
113
117
  ck/sampling/wmc_rejection_sampler.py,sha256=Kk7hDvfnI37CQhFlAW2-UoxtoSbQBoMesghMlwrX6_Y,4782
114
118
  ck/sampling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
119
  ck/sampling/marginals_direct_sampler.py,sha256=S4kfmvgPfh_dyn-D2WumrH6SMvLc6sFF7fRswGOS1gA,4353
@@ -128,10 +132,10 @@ ck/utils/map_list.py,sha256=0UkTDg-ZlWkuxiM-1OhaUYh5MRgMz0rAppDtE2RryEY,3719
128
132
  ck/pgm_compiler/__init__.py,sha256=Ga0dTOetOovHwNN4WS-o4fyyh7255xL0bUTdK29p2LY,110
129
133
  ck/pgm_compiler/recursive_conditioning.py,sha256=vdDSrMO1yPQHNlLQha5ybg3a7l1SiygsmniI_pQhU-Q,7705
130
134
  ck/pgm_compiler/named_pgm_compilers.py,sha256=TIgr2aqNYTzwlNqQJ3wgWDiW0gLplU24tpKgmWR7XuE,3316
131
- ck/pgm_compiler/pgm_compiler.py,sha256=VRGxWcnXgyXd1Twusw8tm1Yqv1VFPmb2LBsOu4UZv8k,597
135
+ ck/pgm_compiler/pgm_compiler.py,sha256=gI2fhV6GcCP9oPYz2o7qMRtG4AaS8b7lQLRJKmdclFw,603
132
136
  ck/pgm_compiler/factor_elimination.py,sha256=A6pwSJZ3tBNXqrYcp8WXNn86nbwTkOiAzlx6STcqqqI,13412
133
137
  ck/pgm_compiler/variable_elimination.py,sha256=R3dV9Mbw8u2rf7wJ2upGiy1QKjc65gFAOEYCDaD3sZ8,3456
134
- ck/pgm_compiler/support/join_tree.py,sha256=_rNmjp2OjP6aa-IBr4sMwOSnY0tZC1zleHdql4bhn1Q,12562
138
+ ck/pgm_compiler/support/join_tree.py,sha256=vla1lKQ3WM2LxTiuCR0LNm82qVfqPcz8q3j6UvBLyQc,12565
135
139
  ck/pgm_compiler/support/factor_tables.py,sha256=0EKJC0YU8h9J8oFpd6JSjDDooNCaNmIwiQQs7ovrGWY,15150
136
140
  ck/pgm_compiler/support/clusters.py,sha256=r1Z8b4IvXMfY5xeyg5AHoU3TxUI0yNDvh3Xkvj8FDF8,20932
137
141
  ck/pgm_compiler/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -139,32 +143,32 @@ ck/pgm_compiler/support/named_compiler_maker.py,sha256=Qz8a9gwY46Q3dtRCZEZ2czq5z
139
143
  ck/pgm_compiler/support/circuit_table/__init__.py,sha256=1kWjAZR5Rj6PYNdbCEbuyE2VtIDQU4Qf-3HPFzBlezs,562
140
144
  ck/pgm_compiler/support/circuit_table/_circuit_table_cy.pyx,sha256=Fsjw8P9clKQioqlLyr1JirUK5oYkeotpDMy5sMo7Khk,11683
141
145
  ck/pgm_compiler/support/circuit_table/_circuit_table_py.py,sha256=OZJC-JGX3ovCSv7nJtNYq7735KZ2eb4TQOlZdZbhPmk,10983
142
- ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c,sha256=QeAXx4qgQ8_xnkKarf84qZZiZ9ORsu6UGxhziZY0K3A,714044
143
- ck/pgm_compiler/support/circuit_table/_circuit_table_cy.cpython-312-darwin.so,sha256=bikTlfuRSrPYs1SNACe3d7oEddo9ZVGN6VEevsqSHhw,165096
146
+ ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c,sha256=gIlvTH2anpV8zXVpzsq7QRwYIR3uwyNip2MufCOxPmA,714044
147
+ ck/pgm_compiler/support/circuit_table/_circuit_table_cy.cpython-312-darwin.so,sha256=2_H5WQZJYPuinW3bJkRgcWpuIHosnhljWzp8sG1Jaso,165096
144
148
  ck/pgm_compiler/ace/ace.py,sha256=An83dHxE_gQFcEs6H5qgm0PlNFnJSGGuvLJNC2H3hGU,10098
145
149
  ck/pgm_compiler/ace/__init__.py,sha256=5HWep-yL1Mr6z5VWEaIYpLumCdeso85J-l_-hQaVusM,96
146
- ck/program/raw_program.py,sha256=FtPzy1s20fb8bWqjTgw2ZaSHknZT5EDuO88O9zVePMs,2557
150
+ ck/program/raw_program.py,sha256=aUYLEcK8mstDspz6M9wOE1W7TrnDNBmJjPtfIVA3CLw,4158
147
151
  ck/program/program_buffer.py,sha256=IHwAHTKIaUlhcbNFTuSxPWKyExIsOxxX6ffUn4KfheU,5485
148
152
  ck/program/__init__.py,sha256=Rifdxk-l6cCjXLpwc6Q0pVXNDsllAwaFlRqRx3cURho,107
149
153
  ck/program/program.py,sha256=ohsnE0CEy8O4q8uGB_YEjoJKAPhY1Mz_a08Z7fy7TLw,4047
150
154
  ck/circuit_compiler/llvm_compiler.py,sha256=SFhfrthrDuAYUjH_DYRD7FBU8eg2db5T4QGBGfoewnw,13635
151
- ck/circuit_compiler/circuit_compiler.py,sha256=bb-SG8xrcp4y2nCNB0GIWcgOufEsR2Nb52qtrLMHTVs,992
155
+ ck/circuit_compiler/circuit_compiler.py,sha256=Sl7FS42GXrDL6eG_WNKILcSQl7Wlccgs5Dd1l0EZMsU,1121
152
156
  ck/circuit_compiler/__init__.py,sha256=eRN6chBEt64PK5e6EFGyBNZBn6BXhXb6R3m12zPA1Qg,130
153
157
  ck/circuit_compiler/named_circuit_compilers.py,sha256=paKyG876tdG_bdSHJU6KW5HxQrutmV_T80GPpz8A65s,2227
154
- ck/circuit_compiler/interpret_compiler.py,sha256=3MylFp3MoJTNVbVfba4qES7WCVu2UYJ1_vBgO-F0EAE,7149
155
- ck/circuit_compiler/llvm_vm_compiler.py,sha256=-yZ2dPP8eOy0l5x-cVB-v2qpS7gWod2gXg1h44l0HPA,21327
156
- ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py,sha256=mG7yweTxhl_Ez8sDQ9l032A5P3L7ojvAwp7V4vGhjJM,3945
158
+ ck/circuit_compiler/interpret_compiler.py,sha256=tZirNkAOe7evvray4-wOqO-KdaI39qRFEI0xD6IRBY0,8531
159
+ ck/circuit_compiler/llvm_vm_compiler.py,sha256=rM_6F5st3k9X5K1_MwzKJwDhQo1794vooPJ5yKrgSX8,21648
160
+ ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py,sha256=GdtBkipud8vylXYArOJvZ-10U9L_PL0oJrkyrnFGH2Q,4345
157
161
  ck/circuit_compiler/cython_vm_compiler/__init__.py,sha256=ks0sISOJ-XHIHgHnESyFsheNWvcSJQkbsrj1wVlnzTE,48
158
- ck/circuit_compiler/cython_vm_compiler/_compiler.pyx,sha256=uSyNMRd5h0yetA-vi6uA-8O6m_0hfU9w3PxKgM4RAl4,12845
159
- ck/circuit_compiler/cython_vm_compiler/_compiler.cpython-312-darwin.so,sha256=mgXHNZBaYWW6HSeIbxcdTxBe7hVTmRVq2dQiwbUgYHU,163488
160
- ck/circuit_compiler/cython_vm_compiler/_compiler.c,sha256=BA4BeR8fE5CGgJiZPYWTDZK2QbKZ5WvI0Mz0vwXgmeg,857013
161
- ck/circuit_compiler/support/llvm_ir_function.py,sha256=MolcEsjoZvD__r6MvaThrjworzidgIigEG9TiyTTUdI,7545
162
+ ck/circuit_compiler/cython_vm_compiler/_compiler.pyx,sha256=RssdkoAcB3Ahes8xisqFy0PQyOPmC3GLEC2xR-miQaE,12898
163
+ ck/circuit_compiler/cython_vm_compiler/_compiler.cpython-312-darwin.so,sha256=grjng7xlL4OZueLJhLPDb5rulL6Z1_mhlTWIeeN4Fo4,163488
164
+ ck/circuit_compiler/cython_vm_compiler/_compiler.c,sha256=ptwISKYMPYqlHc4zcNqODMqsqPN1Yg61eo8-qeHIISc,857789
165
+ ck/circuit_compiler/support/llvm_ir_function.py,sha256=1uC4gAu2g1nl9lycMN2sM7FMI_h4iJG_ufZ3Gc3rMA8,8361
162
166
  ck/circuit_compiler/support/input_vars.py,sha256=EZrvyhD9XVtf5GuDBluFNWhAOVixP7-_ETxAHLTpBcs,4664
163
167
  ck/circuit_compiler/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
164
168
  ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.pyx,sha256=a0fKmkwRNscJmy6qoO2AOqJYmHYptrQmkRSrDg3G-wg,3233
165
169
  ck/circuit_compiler/support/circuit_analyser/__init__.py,sha256=WhNwfg7GHVeI4k_m7owPGWxX0MyZg_wtcp2MA07qbWg,523
166
- ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.cpython-312-darwin.so,sha256=z4eMgb_hYHkt4mbCMH4-boGDITdXgc9vdvvv-ftfUDw,104936
167
- ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c,sha256=2PtgIVnDZBxqOtZOsNjWZA8-ZJudE79qbvuAdbiMCpk,438223
170
+ ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.cpython-312-darwin.so,sha256=cGsF78tTLe9do8I4OnuA3g7w_eg039CViDCLhDf9u7k,104936
171
+ ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c,sha256=i5ULOzxs7fT4JUyeAX8sQG2jNd_wil_34imoByTuiQw,438223
168
172
  ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_py.py,sha256=CMdXV6Rot5CCoK1UsurQdGK0UOx_09B6V7mCc_6-gfI,2993
169
173
  ck/in_out/render_net.py,sha256=VePvN6aYWuzEkW-Hv-qGT9QneOvsnrBMmS_KYueuj2I,4970
170
174
  ck/in_out/render_bugs.py,sha256=c39KbaD4gEiauFsZq2KUhDEEa-3cuY5kuvz97pEWVpw,3272