compiled-knowledge 4.0.0a22__tar.gz → 4.0.0a23__tar.gz

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 (185) hide show
  1. {compiled_knowledge-4.0.0a22/src/compiled_knowledge.egg-info → compiled_knowledge-4.0.0a23}/PKG-INFO +1 -1
  2. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/pyproject.toml +1 -1
  3. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit/_circuit_cy.c +49 -59
  4. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit/_circuit_cy.pyx +1 -1
  5. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit/_circuit_py.py +1 -1
  6. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/cython_vm_compiler/_compiler.c +27 -18
  7. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/cython_vm_compiler/_compiler.pyx +3 -3
  8. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py +14 -7
  9. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/interpret_compiler.py +35 -4
  10. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/llvm_vm_compiler.py +9 -3
  11. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/support/llvm_ir_function.py +18 -1
  12. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/program/raw_program.py +40 -7
  13. compiled_knowledge-4.0.0a23/src/ck_demos/ace/simple_ace_demo.py +18 -0
  14. compiled_knowledge-4.0.0a23/src/ck_demos/getting_started/simple_demo.py +18 -0
  15. compiled_knowledge-4.0.0a23/src/ck_demos/programs/demo_raw_program_dump.py +17 -0
  16. compiled_knowledge-4.0.0a23/src/ck_demos/utils/__init__.py +0 -0
  17. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23/src/compiled_knowledge.egg-info}/PKG-INFO +1 -1
  18. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/compiled_knowledge.egg-info/SOURCES.txt +4 -0
  19. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/LICENSE.txt +0 -0
  20. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/MANIFEST.in +0 -0
  21. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/README.md +0 -0
  22. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/setup.cfg +0 -0
  23. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/setup.py +0 -0
  24. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/__init__.py +0 -0
  25. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit/__init__.py +0 -0
  26. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit/_circuit_cy.pxd +0 -0
  27. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit/tmp_const.py +0 -0
  28. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/__init__.py +0 -0
  29. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/circuit_compiler.py +0 -0
  30. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/cython_vm_compiler/__init__.py +0 -0
  31. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/llvm_compiler.py +0 -0
  32. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/named_circuit_compilers.py +0 -0
  33. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/support/__init__.py +0 -0
  34. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/support/circuit_analyser/__init__.py +0 -0
  35. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c +0 -0
  36. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.pyx +0 -0
  37. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_py.py +0 -0
  38. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/circuit_compiler/support/input_vars.py +0 -0
  39. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/__init__.py +0 -0
  40. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/alarm.py +0 -0
  41. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/asia.py +0 -0
  42. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/binary_clique.py +0 -0
  43. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/bow_tie.py +0 -0
  44. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/cancer.py +0 -0
  45. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/chain.py +0 -0
  46. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/child.py +0 -0
  47. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/clique.py +0 -0
  48. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/cnf_pgm.py +0 -0
  49. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/diamond_square.py +0 -0
  50. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/earthquake.py +0 -0
  51. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/empty.py +0 -0
  52. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/hailfinder.py +0 -0
  53. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/hepar2.py +0 -0
  54. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/insurance.py +0 -0
  55. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/loop.py +0 -0
  56. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/mildew.py +0 -0
  57. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/munin.py +0 -0
  58. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/pathfinder.py +0 -0
  59. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/rain.py +0 -0
  60. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/rectangle.py +0 -0
  61. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/run.py +0 -0
  62. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/sachs.py +0 -0
  63. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/sprinkler.py +0 -0
  64. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/star.py +0 -0
  65. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/stress.py +0 -0
  66. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/student.py +0 -0
  67. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/survey.py +0 -0
  68. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/triangle_square.py +0 -0
  69. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/example/truss.py +0 -0
  70. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/__init__.py +0 -0
  71. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/parse_ace_lmap.py +0 -0
  72. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/parse_ace_nnf.py +0 -0
  73. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/parse_net.py +0 -0
  74. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/parser_utils.py +0 -0
  75. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/pgm_pickle.py +0 -0
  76. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/pgm_python.py +0 -0
  77. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/render_bugs.py +0 -0
  78. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/render_net.py +0 -0
  79. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/in_out/render_pomegranate.py +0 -0
  80. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm.py +0 -0
  81. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/__init__.py +0 -0
  82. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/marginals_program.py +0 -0
  83. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/mpe_program.py +0 -0
  84. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/pgm_circuit.py +0 -0
  85. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/program_with_slotmap.py +0 -0
  86. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/slot_map.py +0 -0
  87. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/support/__init__.py +0 -0
  88. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/support/compile_circuit.py +0 -0
  89. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/target_marginals_program.py +0 -0
  90. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_circuit/wmc_program.py +0 -0
  91. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/__init__.py +0 -0
  92. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/ace/__init__.py +0 -0
  93. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/ace/ace.py +0 -0
  94. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/factor_elimination.py +0 -0
  95. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/named_pgm_compilers.py +0 -0
  96. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/pgm_compiler.py +0 -0
  97. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/recursive_conditioning.py +0 -0
  98. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/__init__.py +0 -0
  99. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/circuit_table/__init__.py +0 -0
  100. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c +0 -0
  101. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_cy.pyx +0 -0
  102. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_py.py +0 -0
  103. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/clusters.py +0 -0
  104. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/factor_tables.py +0 -0
  105. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/join_tree.py +0 -0
  106. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/support/named_compiler_maker.py +0 -0
  107. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/pgm_compiler/variable_elimination.py +0 -0
  108. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/probability/__init__.py +0 -0
  109. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/probability/empirical_probability_space.py +0 -0
  110. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/probability/pgm_probability_space.py +0 -0
  111. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/probability/probability_space.py +0 -0
  112. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/program/__init__.py +0 -0
  113. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/program/program.py +0 -0
  114. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/program/program_buffer.py +0 -0
  115. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/__init__.py +0 -0
  116. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/forward_sampler.py +0 -0
  117. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/marginals_direct_sampler.py +0 -0
  118. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/sampler.py +0 -0
  119. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/sampler_support.py +0 -0
  120. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/uniform_sampler.py +0 -0
  121. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/wmc_direct_sampler.py +0 -0
  122. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/wmc_gibbs_sampler.py +0 -0
  123. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/wmc_metropolis_sampler.py +0 -0
  124. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/sampling/wmc_rejection_sampler.py +0 -0
  125. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/__init__.py +0 -0
  126. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/iter_extras.py +0 -0
  127. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/local_config.py +0 -0
  128. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/map_list.py +0 -0
  129. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/map_set.py +0 -0
  130. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/np_extras.py +0 -0
  131. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/random_extras.py +0 -0
  132. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck/utils/tmp_dir.py +0 -0
  133. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/__init__.py +0 -0
  134. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/ace/__init__.py +0 -0
  135. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/ace/copy_ace_to_ck.py +0 -0
  136. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/ace/demo_ace.py +0 -0
  137. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/all_demos.py +0 -0
  138. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/circuit/__init__.py +0 -0
  139. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/circuit/demo_circuit_dump.py +0 -0
  140. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/circuit/demo_derivatives.py +0 -0
  141. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/circuit_compiler/__init__.py +0 -0
  142. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/circuit_compiler/compare_circuit_compilers.py +0 -0
  143. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/circuit_compiler/show_llvm_program.py +0 -0
  144. {compiled_knowledge-4.0.0a22/src/ck_demos/pgm → compiled_knowledge-4.0.0a23/src/ck_demos/getting_started}/__init__.py +0 -0
  145. {compiled_knowledge-4.0.0a22/src/ck_demos/pgm_compiler → compiled_knowledge-4.0.0a23/src/ck_demos/pgm}/__init__.py +0 -0
  146. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm/demo_pgm_dump.py +0 -0
  147. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm/demo_pgm_dump_stress.py +0 -0
  148. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm/demo_pgm_string_rendering.py +0 -0
  149. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm/show_examples.py +0 -0
  150. {compiled_knowledge-4.0.0a22/src/ck_demos/pgm_inference → compiled_knowledge-4.0.0a23/src/ck_demos/pgm_compiler}/__init__.py +0 -0
  151. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/compare_pgm_compilers.py +0 -0
  152. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_compiler_dump.py +0 -0
  153. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_factor_elimination.py +0 -0
  154. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_join_tree.py +0 -0
  155. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_marginals_program.py +0 -0
  156. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_mpe_program.py +0 -0
  157. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_pgm_compiler.py +0 -0
  158. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_recursive_conditioning.py +0 -0
  159. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_variable_elimination.py +0 -0
  160. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/demo_wmc_program.py +0 -0
  161. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_compiler/time_fe_compiler.py +0 -0
  162. {compiled_knowledge-4.0.0a22/src/ck_demos/programs → compiled_knowledge-4.0.0a23/src/ck_demos/pgm_inference}/__init__.py +0 -0
  163. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_inference/demo_inferencing_basic.py +0 -0
  164. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_inference/demo_inferencing_mpe_cancer.py +0 -0
  165. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_inference/demo_inferencing_wmc_and_mpe_sprinkler.py +0 -0
  166. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/pgm_inference/demo_inferencing_wmc_student.py +0 -0
  167. {compiled_knowledge-4.0.0a22/src/ck_demos/sampling → compiled_knowledge-4.0.0a23/src/ck_demos/programs}/__init__.py +0 -0
  168. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/programs/demo_program_buffer.py +0 -0
  169. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/programs/demo_program_multi.py +0 -0
  170. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/programs/demo_program_none.py +0 -0
  171. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/programs/demo_program_single.py +0 -0
  172. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/programs/demo_raw_program_interpreted.py +0 -0
  173. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/programs/demo_raw_program_llvm.py +0 -0
  174. {compiled_knowledge-4.0.0a22/src/ck_demos/utils → compiled_knowledge-4.0.0a23/src/ck_demos/sampling}/__init__.py +0 -0
  175. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/sampling/check_sampler.py +0 -0
  176. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/sampling/demo_marginal_direct_sampler.py +0 -0
  177. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/sampling/demo_uniform_sampler.py +0 -0
  178. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/sampling/demo_wmc_direct_sampler.py +0 -0
  179. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/utils/compare.py +0 -0
  180. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/utils/convert_network.py +0 -0
  181. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/utils/sample_model.py +0 -0
  182. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/ck_demos/utils/stop_watch.py +0 -0
  183. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/compiled_knowledge.egg-info/dependency_links.txt +0 -0
  184. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/compiled_knowledge.egg-info/requires.txt +0 -0
  185. {compiled_knowledge-4.0.0a22 → compiled_knowledge-4.0.0a23}/src/compiled_knowledge.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compiled-knowledge
3
- Version: 4.0.0a22
3
+ Version: 4.0.0a23
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "compiled-knowledge"
3
- version = "4.0.0a22"
3
+ version = "4.0.0a23"
4
4
  description = "A Python package for compiling and querying discrete probabilistic graphical models."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1764,7 +1764,7 @@ struct __pyx_obj_2ck_7circuit_11_circuit_cy___pyx_scope_struct_6_dump {
1764
1764
 
1765
1765
 
1766
1766
  /* "ck/circuit/_circuit_cy.pyx":364
1767
- * for op in reversed(self.ops):
1767
+ * for op in self.ops:
1768
1768
  * op_name = node_name[id(op)]
1769
1769
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
1770
1770
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -3042,7 +3042,6 @@ static PyObject *__pyx_builtin_range;
3042
3042
  static PyObject *__pyx_builtin_print;
3043
3043
  static PyObject *__pyx_builtin_id;
3044
3044
  static PyObject *__pyx_builtin_enumerate;
3045
- static PyObject *__pyx_builtin_reversed;
3046
3045
  static PyObject *__pyx_builtin_RuntimeError;
3047
3046
  static PyObject *__pyx_builtin_super;
3048
3047
  /* #### Code section: string_decls ### */
@@ -3181,7 +3180,6 @@ static const char __pyx_k_op_nodes[] = "op nodes: ";
3181
3180
  static const char __pyx_k_overload[] = "overload";
3182
3181
  static const char __pyx_k_pyx_type[] = "__pyx_type";
3183
3182
  static const char __pyx_k_qualname[] = "__qualname__";
3184
- static const char __pyx_k_reversed[] = "reversed";
3185
3183
  static const char __pyx_k_set_name[] = "__set_name__";
3186
3184
  static const char __pyx_k_setstate[] = "__setstate__";
3187
3185
  static const char __pyx_k_var_name[] = "var_name";
@@ -3320,7 +3318,7 @@ static const char __pyx_k_T_a_G1F_a_vWA_q_t87_s_fG1_q_d_7[] = "\200\001\360\010\
3320
3318
  static const char __pyx_k_T_d_8_G4_SWWX_G1F_a_vWA_q_t_we3[] = "\200\001\360\010\000\005\016\210T\220\035\230d\320\"8\270\004\270G\3004\300|\320SW\320WX\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\230<\240w\250e\2603\260d\320:O\310w\320V[\320[^\320^b\320bh\320ho\320ot\320tw\320w{\360\000\000|\001F\002\360\000\000F\002M\002\360\000\000M\002N\002\330\004\007\200q\330\010\017\320\017'\240t\2501\250G\260;\270g\300Q\340\010\017\320\017'\240t\2501\250G\260;\270a";
3321
3319
  static const char __pyx_k_T_fD_dRYY_G1F_a_vWA_q_t_2_c_QXX[] = "\200\001\360\010\000\005\016\210T\320\021)\250\024\250]\270$\270f\300D\310\006\310d\320RY\320Y]\320]^\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\320\0332\260'\270\025\270c\300\024\300\\\320QX\320X]\320]`\320`d\320di\320ip\320pu\320ux\320x|\360\000\000}\001B\002\360\000\000B\002I\002\360\000\000I\002N\002\360\000\000N\002Q\002\360\000\000Q\002U\002\360\000\000U\002[\002\360\000\000[\002b\002\360\000\000b\002g\002\360\000\000g\002j\002\360\000\000j\002n\002\360\000\000n\002t\002\360\000\000t\002{\002\360\000\000{\002|\002\330\004\007\200q\330\010\017\320\017(\250\004\250A\250W\260K\270w\300a\340\010\017\320\017(\250\004\250A\250W\260K\270q";
3322
3320
  static const char __pyx_k_T_j_F_it1_G1F_a_vWA_q_t87_s_iwa[] = "\200\001\360\010\000\005\016\210T\220\031\230$\230j\250\004\250F\260$\260i\270t\3001\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\2308\2407\250%\250s\260$\260i\270w\300a\330\004\007\200q\330\010\017\320\017(\250\004\250A\250W\260K\270w\300a\340\010\017\320\017(\250\004\250A\250W\260K\270q";
3323
- static const char __pyx_k_A_Q_1_7_A_A_Qb_D_Qb_34q_Qb_0_A_Q[] = "\200A\360\006\000\025\033\230!\330\024\032\230!\330\027-\250Q\330\034#\2401\330\t\n\360\030\000\t\034\2307\240\"\240A\340\010$\240A\340\010\r\210Q\210b\220\004\320\024,\250D\260\001\330\010\r\210Q\210b\220\004\320\0243\2604\260q\330\010\r\210Q\210b\220\004\320\0240\260\004\260A\330\010\r\210Q\210b\220\004\320\0242\260$\260a\330\010\r\210Q\210b\220\004\320\024,\250D\260\001\340\010\r\210Q\210b\220\004\320\024'\240t\2501\330\010\014\210G\2204\220q\330\014\025\220Q\220b\230\001\230\030\240\022\2408\2503\250a\330\014\034\230F\240*\250C\250u\260C\260s\270%\270s\300#\300Q\320FV\320V_\320_`\320`c\320cd\330\014\017\210y\230\003\2301\330\020\023\2203\220i\230q\330\024\031\230\021\230\"\230D\320 1\260\023\260I\270\\\310\023\310F\320RS\340\024\031\230\021\230\"\230D\320 1\260\023\260I\270Q\330\021\024\220I\230Q\330\020\025\220Q\220b\230\004\320\034-\250S\260\t\270\023\270F\300!\340\010\013\2101\330\014\021\220\021\220\"\220D\320\030-\250T\260\021\330\014\020\220\t\230\024\230[\250\007\250q\330\020\025\220Q\220b\230\004\230M\250\025\250a\360\006\000\t\r\210I\220T\230\033\240G\2501\330\014\025\220Q\220b\230\001\230\032\2404\240q\250\005\250Q\360\006\000\t\r\210C\210v\220Y\230a\230t\2401\330\014\025\220Q\220b\230\001\230\027\240\002\240$\240b\250\007\250u\260A\340\010\r\210Q\330\014\016\210d\320\022$\240D\250\001\330\016\031\230\024\320\0355\260T\270\021\340\010\014\210F\220(\230!\2304\230q\330\014\026\220i\230q\240\002\240!\2401\330\014\027\220s\230%\230z\250\021\330\014\021\220\021\220\"\220D\230\r\240[\260\001";
3321
+ static const char __pyx_k_A_Q_1_7_A_A_Qb_D_Qb_34q_Qb_0_A_Q[] = "\200A\360\006\000\025\033\230!\330\024\032\230!\330\027-\250Q\330\034#\2401\330\t\n\360\030\000\t\034\2307\240\"\240A\340\010$\240A\340\010\r\210Q\210b\220\004\320\024,\250D\260\001\330\010\r\210Q\210b\220\004\320\0243\2604\260q\330\010\r\210Q\210b\220\004\320\0240\260\004\260A\330\010\r\210Q\210b\220\004\320\0242\260$\260a\330\010\r\210Q\210b\220\004\320\024,\250D\260\001\340\010\r\210Q\210b\220\004\320\024'\240t\2501\330\010\014\210G\2204\220q\330\014\025\220Q\220b\230\001\230\030\240\022\2408\2503\250a\330\014\034\230F\240*\250C\250u\260C\260s\270%\270s\300#\300Q\320FV\320V_\320_`\320`c\320cd\330\014\017\210y\230\003\2301\330\020\023\2203\220i\230q\330\024\031\230\021\230\"\230D\320 1\260\023\260I\270\\\310\023\310F\320RS\340\024\031\230\021\230\"\230D\320 1\260\023\260I\270Q\330\021\024\220I\230Q\330\020\025\220Q\220b\230\004\320\034-\250S\260\t\270\023\270F\300!\340\010\013\2101\330\014\021\220\021\220\"\220D\320\030-\250T\260\021\330\014\020\220\t\230\024\230[\250\007\250q\330\020\025\220Q\220b\230\004\230M\250\025\250a\360\006\000\t\r\210I\220T\230\033\240G\2501\330\014\025\220Q\220b\230\001\230\032\2404\240q\250\005\250Q\360\006\000\t\r\210C\210v\220Y\230a\230t\2401\330\014\025\220Q\220b\230\001\230\027\240\002\240$\240b\250\007\250u\260A\340\010\r\210Q\330\014\016\210d\320\022$\240D\250\001\330\016\031\230\024\320\0355\260T\270\021\340\010\014\210F\220$\220a\330\014\026\220i\230q\240\002\240!\2401\330\014\027\220s\230%\230z\250\021\330\014\021\220\021\220\"\220D\230\r\240[\260\001";
3324
3322
  static const char __pyx_k_Circuit_remove_derivatives_cache[] = "Circuit.remove_derivatives_cache";
3325
3323
  static const char __pyx_k_Circuit_remove_unreachable_op_no[] = "Circuit.remove_unreachable_op_nodes";
3326
3324
  static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x769839a, 0xe0847da, 0xcebc8c6) = (_Circuit__derivatives, _const_map, one, ops, vars, zero))";
@@ -3535,7 +3533,7 @@ typedef struct {
3535
3533
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3536
3534
  PyObject *__pyx_tuple[8];
3537
3535
  PyObject *__pyx_codeobj_tab[49];
3538
- PyObject *__pyx_string_tab[243];
3536
+ PyObject *__pyx_string_tab[242];
3539
3537
  PyObject *__pyx_int_0;
3540
3538
  PyObject *__pyx_int_1;
3541
3539
  PyObject *__pyx_int_16976299;
@@ -3866,42 +3864,41 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
3866
3864
  #define __pyx_n_u_remove_unreachable_op_nodes __pyx_string_tab[204]
3867
3865
  #define __pyx_n_u_result __pyx_string_tab[205]
3868
3866
  #define __pyx_n_u_return __pyx_string_tab[206]
3869
- #define __pyx_n_u_reversed __pyx_string_tab[207]
3870
- #define __pyx_n_u_self __pyx_string_tab[208]
3871
- #define __pyx_n_u_self_multiply __pyx_string_tab[209]
3872
- #define __pyx_n_u_send __pyx_string_tab[210]
3873
- #define __pyx_n_u_set_name __pyx_string_tab[211]
3874
- #define __pyx_n_u_setstate __pyx_string_tab[212]
3875
- #define __pyx_n_u_setstate_cython __pyx_string_tab[213]
3876
- #define __pyx_n_u_single_result __pyx_string_tab[214]
3877
- #define __pyx_kp_u_src_ck_circuit__circuit_cy_pyx __pyx_string_tab[215]
3878
- #define __pyx_n_u_state __pyx_string_tab[216]
3879
- #define __pyx_n_u_str __pyx_string_tab[217]
3880
- #define __pyx_kp_u_stringsource __pyx_string_tab[218]
3881
- #define __pyx_n_u_sum __pyx_string_tab[219]
3882
- #define __pyx_n_u_super __pyx_string_tab[220]
3883
- #define __pyx_n_u_symbol __pyx_string_tab[221]
3884
- #define __pyx_n_u_test __pyx_string_tab[222]
3885
- #define __pyx_n_u_throw __pyx_string_tab[223]
3886
- #define __pyx_n_u_to_add __pyx_string_tab[224]
3887
- #define __pyx_n_u_to_mul __pyx_string_tab[225]
3888
- #define __pyx_n_u_typing __pyx_string_tab[226]
3889
- #define __pyx_n_u_update __pyx_string_tab[227]
3890
- #define __pyx_n_u_use_setstate __pyx_string_tab[228]
3891
- #define __pyx_n_u_value __pyx_string_tab[229]
3892
- #define __pyx_n_u_values __pyx_string_tab[230]
3893
- #define __pyx_kp_u_var __pyx_string_tab[231]
3894
- #define __pyx_n_u_var_2 __pyx_string_tab[232]
3895
- #define __pyx_n_u_var_name __pyx_string_tab[233]
3896
- #define __pyx_n_u_var_names __pyx_string_tab[234]
3897
- #define __pyx_kp_u_var_nodes __pyx_string_tab[235]
3898
- #define __pyx_n_u_x __pyx_string_tab[236]
3899
- #define __pyx_n_u_xs __pyx_string_tab[237]
3900
- #define __pyx_n_u_xs_list __pyx_string_tab[238]
3901
- #define __pyx_n_u_y __pyx_string_tab[239]
3902
- #define __pyx_n_u_ys __pyx_string_tab[240]
3903
- #define __pyx_n_u_ys_list __pyx_string_tab[241]
3904
- #define __pyx_n_u_zero __pyx_string_tab[242]
3867
+ #define __pyx_n_u_self __pyx_string_tab[207]
3868
+ #define __pyx_n_u_self_multiply __pyx_string_tab[208]
3869
+ #define __pyx_n_u_send __pyx_string_tab[209]
3870
+ #define __pyx_n_u_set_name __pyx_string_tab[210]
3871
+ #define __pyx_n_u_setstate __pyx_string_tab[211]
3872
+ #define __pyx_n_u_setstate_cython __pyx_string_tab[212]
3873
+ #define __pyx_n_u_single_result __pyx_string_tab[213]
3874
+ #define __pyx_kp_u_src_ck_circuit__circuit_cy_pyx __pyx_string_tab[214]
3875
+ #define __pyx_n_u_state __pyx_string_tab[215]
3876
+ #define __pyx_n_u_str __pyx_string_tab[216]
3877
+ #define __pyx_kp_u_stringsource __pyx_string_tab[217]
3878
+ #define __pyx_n_u_sum __pyx_string_tab[218]
3879
+ #define __pyx_n_u_super __pyx_string_tab[219]
3880
+ #define __pyx_n_u_symbol __pyx_string_tab[220]
3881
+ #define __pyx_n_u_test __pyx_string_tab[221]
3882
+ #define __pyx_n_u_throw __pyx_string_tab[222]
3883
+ #define __pyx_n_u_to_add __pyx_string_tab[223]
3884
+ #define __pyx_n_u_to_mul __pyx_string_tab[224]
3885
+ #define __pyx_n_u_typing __pyx_string_tab[225]
3886
+ #define __pyx_n_u_update __pyx_string_tab[226]
3887
+ #define __pyx_n_u_use_setstate __pyx_string_tab[227]
3888
+ #define __pyx_n_u_value __pyx_string_tab[228]
3889
+ #define __pyx_n_u_values __pyx_string_tab[229]
3890
+ #define __pyx_kp_u_var __pyx_string_tab[230]
3891
+ #define __pyx_n_u_var_2 __pyx_string_tab[231]
3892
+ #define __pyx_n_u_var_name __pyx_string_tab[232]
3893
+ #define __pyx_n_u_var_names __pyx_string_tab[233]
3894
+ #define __pyx_kp_u_var_nodes __pyx_string_tab[234]
3895
+ #define __pyx_n_u_x __pyx_string_tab[235]
3896
+ #define __pyx_n_u_xs __pyx_string_tab[236]
3897
+ #define __pyx_n_u_xs_list __pyx_string_tab[237]
3898
+ #define __pyx_n_u_y __pyx_string_tab[238]
3899
+ #define __pyx_n_u_ys __pyx_string_tab[239]
3900
+ #define __pyx_n_u_ys_list __pyx_string_tab[240]
3901
+ #define __pyx_n_u_zero __pyx_string_tab[241]
3905
3902
  /* #### Code section: module_state_clear ### */
3906
3903
  #if CYTHON_USE_MODULE_STATE
3907
3904
  static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
@@ -3962,7 +3959,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
3962
3959
  Py_CLEAR(clear_module_state->__pyx_type_2ck_7circuit_11_circuit_cy___pyx_scope_struct_10_genexpr);
3963
3960
  for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
3964
3961
  for (int i=0; i<49; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3965
- for (int i=0; i<243; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3962
+ for (int i=0; i<242; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3966
3963
  Py_CLEAR(clear_module_state->__pyx_int_0);
3967
3964
  Py_CLEAR(clear_module_state->__pyx_int_1);
3968
3965
  Py_CLEAR(clear_module_state->__pyx_int_16976299);
@@ -4049,7 +4046,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void
4049
4046
  Py_VISIT(traverse_module_state->__pyx_type_2ck_7circuit_11_circuit_cy___pyx_scope_struct_10_genexpr);
4050
4047
  for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4051
4048
  for (int i=0; i<49; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4052
- for (int i=0; i<243; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4049
+ for (int i=0; i<242; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4053
4050
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
4054
4051
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
4055
4052
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_16976299);
@@ -8192,7 +8189,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
8192
8189
  static PyObject *__pyx_gb_2ck_7circuit_11_circuit_cy_7Circuit_4dump_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
8193
8190
 
8194
8191
  /* "ck/circuit/_circuit_cy.pyx":364
8195
- * for op in reversed(self.ops):
8192
+ * for op in self.ops:
8196
8193
  * op_name = node_name[id(op)]
8197
8194
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
8198
8195
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9271,7 +9268,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9271
9268
  * f'{prefix}op nodes: {self.number_of_op_nodes} '
9272
9269
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})' # <<<<<<<<<<<<<<
9273
9270
  * )
9274
- * for op in reversed(self.ops):
9271
+ * for op in self.ops:
9275
9272
  */
9276
9273
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_number_of_arcs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 360, __pyx_L1_error)
9277
9274
  __Pyx_GOTREF(__pyx_t_13);
@@ -9320,7 +9317,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9320
9317
  /* "ck/circuit/_circuit_cy.pyx":362
9321
9318
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
9322
9319
  * )
9323
- * for op in reversed(self.ops): # <<<<<<<<<<<<<<
9320
+ * for op in self.ops: # <<<<<<<<<<<<<<
9324
9321
  * op_name = node_name[id(op)]
9325
9322
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9326
9323
  */
@@ -9329,13 +9326,8 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9329
9326
  __PYX_ERR(0, 362, __pyx_L1_error)
9330
9327
  }
9331
9328
  __pyx_t_1 = __pyx_v_self->ops; __Pyx_INCREF(__pyx_t_1);
9332
- __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_t_1);
9333
- #if !CYTHON_ASSUME_SAFE_SIZE
9334
- if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 362, __pyx_L1_error)
9335
- #endif
9336
- --__pyx_t_8;
9329
+ __pyx_t_8 = 0;
9337
9330
  for (;;) {
9338
- if (__pyx_t_8 < 0) break;
9339
9331
  {
9340
9332
  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
9341
9333
  #if !CYTHON_ASSUME_SAFE_SIZE
@@ -9344,7 +9336,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9344
9336
  if (__pyx_t_8 >= __pyx_temp) break;
9345
9337
  }
9346
9338
  __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_8);
9347
- --__pyx_t_8;
9339
+ ++__pyx_t_8;
9348
9340
  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 362, __pyx_L1_error)
9349
9341
  __Pyx_GOTREF(__pyx_t_14);
9350
9342
  __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_14);
@@ -9352,7 +9344,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9352
9344
 
9353
9345
  /* "ck/circuit/_circuit_cy.pyx":363
9354
9346
  * )
9355
- * for op in reversed(self.ops):
9347
+ * for op in self.ops:
9356
9348
  * op_name = node_name[id(op)] # <<<<<<<<<<<<<<
9357
9349
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9358
9350
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9376,7 +9368,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9376
9368
  __pyx_t_2 = 0;
9377
9369
 
9378
9370
  /* "ck/circuit/_circuit_cy.pyx":364
9379
- * for op in reversed(self.ops):
9371
+ * for op in self.ops:
9380
9372
  * op_name = node_name[id(op)]
9381
9373
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args) # <<<<<<<<<<<<<<
9382
9374
  * print(f'{next_prefix}{op_name}: {args_str}')
@@ -9434,7 +9426,7 @@ static PyObject *__pyx_pf_2ck_7circuit_11_circuit_cy_7Circuit_30dump(struct __py
9434
9426
  /* "ck/circuit/_circuit_cy.pyx":362
9435
9427
  * f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
9436
9428
  * )
9437
- * for op in reversed(self.ops): # <<<<<<<<<<<<<<
9429
+ * for op in self.ops: # <<<<<<<<<<<<<<
9438
9430
  * op_name = node_name[id(op)]
9439
9431
  * args_str = ' '.join(node_name[id(arg)] for arg in op.args)
9440
9432
  */
@@ -28894,7 +28886,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
28894
28886
  {__pyx_k_remove_unreachable_op_nodes, sizeof(__pyx_k_remove_unreachable_op_nodes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove_unreachable_op_nodes */
28895
28887
  {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */
28896
28888
  {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */
28897
- {__pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reversed */
28898
28889
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
28899
28890
  {__pyx_k_self_multiply, sizeof(__pyx_k_self_multiply), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self_multiply */
28900
28891
  {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
@@ -28944,7 +28935,6 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
28944
28935
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 327, __pyx_L1_error)
28945
28936
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(0, 335, __pyx_L1_error)
28946
28937
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 355, __pyx_L1_error)
28947
- __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 362, __pyx_L1_error)
28948
28938
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 424, __pyx_L1_error)
28949
28939
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 473, __pyx_L1_error)
28950
28940
  return 0;
@@ -29170,7 +29160,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
29170
29160
  __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_ck_circuit__circuit_cy_pyx, __pyx_mstate->__pyx_n_u_reachable_op_nodes, __pyx_k_2_4_AQ_t_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
29171
29161
  }
29172
29162
  {
29173
- const __Pyx_PyCode_New_function_description descr = {1, 0, 4, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304, 499};
29163
+ const __Pyx_PyCode_New_function_description descr = {1, 0, 4, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304, 495};
29174
29164
  PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_indent, __pyx_mstate->__pyx_n_u_var_names, __pyx_mstate->__pyx_n_u_include_consts, __pyx_mstate->__pyx_n_u_next_prefix, __pyx_mstate->__pyx_n_u_node_name, __pyx_mstate->__pyx_n_u_var_2, __pyx_mstate->__pyx_n_u_var_name, __pyx_mstate->__pyx_n_u_const, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_op_name, __pyx_mstate->__pyx_n_u_args_str, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
29175
29165
  __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_ck_circuit__circuit_cy_pyx, __pyx_mstate->__pyx_n_u_dump, __pyx_k_A_Q_1_7_A_A_Qb_D_Qb_34q_Qb_0_A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
29176
29166
  }
@@ -359,7 +359,7 @@ cdef class Circuit:
359
359
  f'{prefix}op nodes: {self.number_of_op_nodes} '
360
360
  f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
361
361
  )
362
- for op in reversed(self.ops):
362
+ for op in self.ops:
363
363
  op_name = node_name[id(op)]
364
364
  args_str = ' '.join(node_name[id(arg)] for arg in op.args)
365
365
  print(f'{next_prefix}{op_name}: {args_str}')
@@ -413,7 +413,7 @@ class Circuit:
413
413
  f'{prefix}op nodes: {self.number_of_op_nodes} '
414
414
  f'(arcs: {self.number_of_arcs}, ops: {self.number_of_operations})'
415
415
  )
416
- for op in reversed(self.ops):
416
+ for op in self.ops:
417
417
  op_name = node_name[id(op)]
418
418
  args_str = ' '.join(node_name[id(arg)] for arg in op.args)
419
419
  print(f'{next_prefix}{op_name}: {args_str}')
@@ -1800,7 +1800,7 @@ struct __pyx_obj_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_Instruct
1800
1800
  /* "ck/circuit_compiler/cython_vm_compiler/_compiler.pyx":41
1801
1801
  *
1802
1802
  *
1803
- * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int]: # <<<<<<<<<<<<<<
1803
+ * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int, int]: # <<<<<<<<<<<<<<
1804
1804
  * """
1805
1805
  * Make a RawProgram function that interprets the circuit.
1806
1806
  */
@@ -3005,12 +3005,12 @@ static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3005
3005
  static const char __pyx_k_ck_program_raw_program[] = "ck.program.raw_program";
3006
3006
  static const char __pyx_k_cvm_type_name_unexpected[] = "cvm_type_name unexpected: ";
3007
3007
  static const char __pyx_k_Instructions___reduce_cython[] = "Instructions.__reduce_cython__";
3008
- static const char __pyx_k_Tuple_RawProgramFunction_int[] = "Tuple[RawProgramFunction, int]";
3009
3008
  static const char __pyx_k_make_function_locals_function[] = "make_function.<locals>.function";
3010
- static const char __pyx_k_44EQ_az_r_JoQa_7_1_1_S_Yl_HOST[] = "\320\000\034\320\0344\3204E\300Q\360\034\000\005\023\220,\320\036>\270a\270z\310\021\340\004\017\210r\220\030\230\021\230\"\230J\240o\260Q\260a\330\004\022\220)\2307\240(\250!\2501\340\004\031\320\031*\250!\2501\360\006\000\005\010\200~\220S\230\001\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\032\000\t\017\210j\230\001\230\022\320\0339\270\021\340\004\013\210:\220S\230\001\230\030\240\021";
3009
+ static const char __pyx_k_44EQ_az_r_JoQa_7_1_1_S_Yl_HOST[] = "\320\000\034\320\0344\3204E\300Q\360\034\000\005\023\220,\320\036>\270a\270z\310\021\340\004\017\210r\220\030\230\021\230\"\230J\240o\260Q\260a\330\004\022\220)\2307\240(\250!\2501\340\004\031\320\031*\250!\2501\360\006\000\005\010\200~\220S\230\001\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\030\000\n\030\220s\230!\330\010\025\220Y\230l\250&\260\014\270H\300O\320ST\360\032\000\t\017\210j\230\001\230\022\320\0339\270\021\340\004\013\210:\220S\230\001\230\030\240\035\250c\260\021\260(\270!";
3011
3010
  static const char __pyx_k_Instructions___setstate_cython[] = "Instructions.__setstate_cython__";
3012
3011
  static const char __pyx_k_00DOST_r_ay_A_Be1F_Ja_b_Qm2Zq_b[] = "\320\010\036\320\0360\3200D\300O\320ST\330\014'\240r\250\025\250a\250y\270\002\270*\300A\330\014$\240B\240e\2501\250F\260\"\260J\270a\330\014&\240b\250\005\250Q\250m\2702\270Z\300q\330\014&\240b\250\005\250Q\250h\260b\270\n\300!\330\014\017\210q\220\007\220q\330\020\033\2301\330\020\033\2301\330\020\033\2301\330\020\033\2301\330\020\021";
3013
3012
  static const char __pyx_k_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'array'";
3013
+ static const char __pyx_k_Tuple_RawProgramFunction_int_int[] = "Tuple[RawProgramFunction, int, int]";
3014
3014
  static const char __pyx_k_ck_circuit_compiler_cython_vm_co[] = "ck.circuit_compiler.cython_vm_compiler._compiler";
3015
3015
  static const char __pyx_k_ck_circuit_compiler_support_circ[] = "ck.circuit_compiler.support.circuit_analyser";
3016
3016
  static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
@@ -3161,7 +3161,7 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
3161
3161
  #define __pyx_n_u_POINTER __pyx_string_tab[19]
3162
3162
  #define __pyx_n_u_RawProgramFunction __pyx_string_tab[20]
3163
3163
  #define __pyx_n_u_Tuple __pyx_string_tab[21]
3164
- #define __pyx_kp_u_Tuple_RawProgramFunction_int __pyx_string_tab[22]
3164
+ #define __pyx_kp_u_Tuple_RawProgramFunction_int_int __pyx_string_tab[22]
3165
3165
  #define __pyx_n_u_TypeError __pyx_string_tab[23]
3166
3166
  #define __pyx_n_u_ValueError __pyx_string_tab[24]
3167
3167
  #define __pyx_kp_u__2 __pyx_string_tab[25]
@@ -5408,7 +5408,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
5408
5408
  /* "ck/circuit_compiler/cython_vm_compiler/_compiler.pyx":41
5409
5409
  *
5410
5410
  *
5411
- * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int]: # <<<<<<<<<<<<<<
5411
+ * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int, int]: # <<<<<<<<<<<<<<
5412
5412
  * """
5413
5413
  * Make a RawProgram function that interprets the circuit.
5414
5414
  */
@@ -5421,7 +5421,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5421
5421
  PyObject *__pyx_args, PyObject *__pyx_kwds
5422
5422
  #endif
5423
5423
  ); /*proto*/
5424
- PyDoc_STRVAR(__pyx_doc_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_make_function, "\n Make a RawProgram function that interprets the circuit.\n\n Args:\n analysis: A circuit analysis object defining the function.\n dtype: a numpy data type that must be a key in the dictionary, DTYPE_TO_CVM_TYPE.\n\n Returns:\n (function, number_of_tmps)\n ");
5424
+ PyDoc_STRVAR(__pyx_doc_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_make_function, "\n Make a RawProgram function that interprets the circuit.\n\n Args:\n analysis: A circuit analysis object defining the function.\n dtype: a numpy data type that must be a key in the dictionary, DTYPE_TO_CVM_TYPE.\n\n Returns:\n (function, number_of_tmps, number_of_instructions)\n ");
5425
5425
  static PyMethodDef __pyx_mdef_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_1make_function = {"make_function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_1make_function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_make_function};
5426
5426
  static PyObject *__pyx_pw_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_1make_function(PyObject *__pyx_self,
5427
5427
  #if CYTHON_METH_FASTCALL
@@ -7320,7 +7320,7 @@ static PyObject *__pyx_pf_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler
7320
7320
  /* "ck/circuit_compiler/cython_vm_compiler/_compiler.pyx":41
7321
7321
  *
7322
7322
  *
7323
- * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int]: # <<<<<<<<<<<<<<
7323
+ * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int, int]: # <<<<<<<<<<<<<<
7324
7324
  * """
7325
7325
  * Make a RawProgram function that interprets the circuit.
7326
7326
  */
@@ -7693,7 +7693,7 @@ static PyObject *__pyx_pf_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler
7693
7693
  * else:
7694
7694
  * raise ValueError(f'cvm_type_name unexpected: {cvm_type_name!r}') # <<<<<<<<<<<<<<
7695
7695
  *
7696
- * return function, len(analysis.op_to_tmp)
7696
+ * return function, len(analysis.op_to_tmp), len(analysis.op_nodes)
7697
7697
  */
7698
7698
  /*else*/ {
7699
7699
  __pyx_t_2 = NULL;
@@ -7723,7 +7723,7 @@ static PyObject *__pyx_pf_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler
7723
7723
  /* "ck/circuit_compiler/cython_vm_compiler/_compiler.pyx":131
7724
7724
  * raise ValueError(f'cvm_type_name unexpected: {cvm_type_name!r}')
7725
7725
  *
7726
- * return function, len(analysis.op_to_tmp) # <<<<<<<<<<<<<<
7726
+ * return function, len(analysis.op_to_tmp), len(analysis.op_nodes) # <<<<<<<<<<<<<<
7727
7727
  *
7728
7728
  * # VM instructions
7729
7729
  */
@@ -7734,22 +7734,31 @@ static PyObject *__pyx_pf_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler
7734
7734
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7735
7735
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
7736
7736
  __Pyx_GOTREF(__pyx_t_1);
7737
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
7737
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_analysis, __pyx_mstate_global->__pyx_n_u_op_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
7738
7738
  __Pyx_GOTREF(__pyx_t_4);
7739
+ __pyx_t_10 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 131, __pyx_L1_error)
7740
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7741
+ __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
7742
+ __Pyx_GOTREF(__pyx_t_4);
7743
+ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
7744
+ __Pyx_GOTREF(__pyx_t_7);
7739
7745
  __Pyx_INCREF(__pyx_v_function);
7740
7746
  __Pyx_GIVEREF(__pyx_v_function);
7741
- if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function) != (0)) __PYX_ERR(0, 131, __pyx_L1_error);
7747
+ if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_function) != (0)) __PYX_ERR(0, 131, __pyx_L1_error);
7742
7748
  __Pyx_GIVEREF(__pyx_t_1);
7743
- if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 131, __pyx_L1_error);
7749
+ if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 131, __pyx_L1_error);
7750
+ __Pyx_GIVEREF(__pyx_t_4);
7751
+ if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4) != (0)) __PYX_ERR(0, 131, __pyx_L1_error);
7744
7752
  __pyx_t_1 = 0;
7745
- __pyx_r = ((PyObject*)__pyx_t_4);
7746
7753
  __pyx_t_4 = 0;
7754
+ __pyx_r = ((PyObject*)__pyx_t_7);
7755
+ __pyx_t_7 = 0;
7747
7756
  goto __pyx_L0;
7748
7757
 
7749
7758
  /* "ck/circuit_compiler/cython_vm_compiler/_compiler.pyx":41
7750
7759
  *
7751
7760
  *
7752
- * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int]: # <<<<<<<<<<<<<<
7761
+ * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int, int]: # <<<<<<<<<<<<<<
7753
7762
  * """
7754
7763
  * Make a RawProgram function that interprets the circuit.
7755
7764
  */
@@ -12186,7 +12195,7 @@ __Pyx_RefNannySetupContext("PyInit__compiler", 0);
12186
12195
  /* "ck/circuit_compiler/cython_vm_compiler/_compiler.pyx":41
12187
12196
  *
12188
12197
  *
12189
- * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int]: # <<<<<<<<<<<<<<
12198
+ * def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int, int]: # <<<<<<<<<<<<<<
12190
12199
  * """
12191
12200
  * Make a RawProgram function that interprets the circuit.
12192
12201
  */
@@ -12194,7 +12203,7 @@ __Pyx_RefNannySetupContext("PyInit__compiler", 0);
12194
12203
  __Pyx_GOTREF(__pyx_t_3);
12195
12204
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_analysis, __pyx_mstate_global->__pyx_n_u_CircuitAnalysis) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
12196
12205
  if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dtype, __pyx_mstate_global->__pyx_n_u_DTypeNumeric) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
12197
- if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Tuple_RawProgramFunction_int) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
12206
+ if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Tuple_RawProgramFunction_int_int) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
12198
12207
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_2ck_16circuit_compiler_18cython_vm_compiler_9_compiler_1make_function, 0, __pyx_mstate_global->__pyx_n_u_make_function, NULL, __pyx_mstate_global->__pyx_n_u_ck_circuit_compiler_cython_vm_co, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
12199
12208
  __Pyx_GOTREF(__pyx_t_5);
12200
12209
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
@@ -12400,7 +12409,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
12400
12409
  {__pyx_k_POINTER, sizeof(__pyx_k_POINTER), 0, 1, 1}, /* PyObject cname: __pyx_n_u_POINTER */
12401
12410
  {__pyx_k_RawProgramFunction, sizeof(__pyx_k_RawProgramFunction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RawProgramFunction */
12402
12411
  {__pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Tuple */
12403
- {__pyx_k_Tuple_RawProgramFunction_int, sizeof(__pyx_k_Tuple_RawProgramFunction_int), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Tuple_RawProgramFunction_int */
12412
+ {__pyx_k_Tuple_RawProgramFunction_int_int, sizeof(__pyx_k_Tuple_RawProgramFunction_int_int), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Tuple_RawProgramFunction_int_int */
12404
12413
  {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */
12405
12414
  {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */
12406
12415
  {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */
@@ -12595,7 +12604,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
12595
12604
  __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_ck_circuit_compiler_cython_v, __pyx_mstate->__pyx_n_u_function, __pyx_k_00DOST_r_ay_A_Be1F_Ja_b_Qm2Zq_b_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
12596
12605
  }
12597
12606
  {
12598
- const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 41, 235};
12607
+ const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 41, 243};
12599
12608
  PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_analysis, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_instructions, __pyx_mstate->__pyx_n_u_np_consts, __pyx_mstate->__pyx_n_u_ptr_type, __pyx_mstate->__pyx_n_u_c_np_consts, __pyx_mstate->__pyx_n_u_cvm_type_name, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_function};
12600
12609
  __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_ck_circuit_compiler_cython_v, __pyx_mstate->__pyx_n_u_make_function, __pyx_k_44EQ_az_r_JoQa_7_1_1_S_Yl_HOST, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
12601
12610
  }
@@ -38,7 +38,7 @@ DTYPE_TO_CVM_TYPE: Dict[DTypeNumeric, str] = {
38
38
  }
39
39
 
40
40
 
41
- def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int]:
41
+ def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawProgramFunction, int, int]:
42
42
  """
43
43
  Make a RawProgram function that interprets the circuit.
44
44
 
@@ -47,7 +47,7 @@ def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawPr
47
47
  dtype: a numpy data type that must be a key in the dictionary, DTYPE_TO_CVM_TYPE.
48
48
 
49
49
  Returns:
50
- (function, number_of_tmps)
50
+ (function, number_of_tmps, number_of_instructions)
51
51
  """
52
52
 
53
53
  cdef Instructions instructions
@@ -128,7 +128,7 @@ def make_function(analysis: CircuitAnalysis, dtype: DTypeNumeric) -> Tuple[RawPr
128
128
  else:
129
129
  raise ValueError(f'cvm_type_name unexpected: {cvm_type_name!r}')
130
130
 
131
- return function, len(analysis.op_to_tmp)
131
+ return function, len(analysis.op_to_tmp), len(analysis.op_nodes)
132
132
 
133
133
  # VM instructions
134
134
  cdef int ADD = circuit.ADD
@@ -48,15 +48,16 @@ class CythonRawProgram(RawProgram):
48
48
  result: Sequence[CircuitNode],
49
49
  dtype: DTypeNumeric,
50
50
  ):
51
- self.in_vars = in_vars
52
- self.result = result
53
-
54
- function, number_of_tmps = _make_function(
51
+ function, number_of_tmps, number_of_instructions = _make_function(
55
52
  var_nodes=in_vars,
56
53
  result_nodes=result,
57
54
  dtype=dtype,
58
55
  )
59
56
 
57
+ self.in_vars = in_vars
58
+ self.result = result
59
+ self.number_of_instructions = number_of_instructions
60
+
60
61
  super().__init__(
61
62
  function=function,
62
63
  dtype=dtype,
@@ -66,6 +67,10 @@ class CythonRawProgram(RawProgram):
66
67
  var_indices=tuple(var.idx for var in in_vars),
67
68
  )
68
69
 
70
+ def dump(self, *, prefix: str = '', indent: str = ' ') -> None:
71
+ super().dump(prefix=prefix, indent=indent)
72
+ print(f'{prefix}number of instructions = {self.number_of_instructions}')
73
+
69
74
  def __getstate__(self):
70
75
  """
71
76
  Support for pickle.
@@ -94,7 +99,7 @@ class CythonRawProgram(RawProgram):
94
99
  self.in_vars = state['in_vars']
95
100
  self.result = state['result']
96
101
 
97
- self.function, _ = _make_function(
102
+ self.function, _, self.number_of_instructions = _make_function(
98
103
  var_nodes=self.in_vars,
99
104
  result_nodes=self.result,
100
105
  dtype=self.dtype,
@@ -105,7 +110,7 @@ def _make_function(
105
110
  var_nodes: Sequence[VarNode],
106
111
  result_nodes: Sequence[CircuitNode],
107
112
  dtype: DTypeNumeric,
108
- ) -> Tuple[RawProgramFunction, int]:
113
+ ) -> Tuple[RawProgramFunction, int, int]:
109
114
  """
110
115
  Make a RawProgram function that interprets the circuit.
111
116
 
@@ -115,7 +120,9 @@ def _make_function(
115
120
  dtype: a numpy data type that must be a key in the dictionary, DTYPE_TO_CVM_TYPE.
116
121
 
117
122
  Returns:
118
- (function, number_of_tmps)
123
+ (function, number_of_tmps, number_of_instructions)
119
124
  """
120
125
  analysis: CircuitAnalysis = analyze_circuit(var_nodes, result_nodes)
126
+ DEBUG = _compiler.make_function(analysis, dtype)
127
+
121
128
  return _compiler.make_function(analysis, dtype)
@@ -1,17 +1,17 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import ctypes as ct
3
4
  from dataclasses import dataclass
4
5
  from typing import Sequence, Optional, Dict, List, Tuple, Callable
5
6
 
6
7
  import numpy as np
7
- import ctypes as ct
8
8
 
9
+ from .support.circuit_analyser import CircuitAnalysis, analyze_circuit
10
+ from .support.input_vars import InputVars, InferVars, infer_input_vars
9
11
  from ..circuit import Circuit, CircuitNode, VarNode, OpNode, ADD, MUL
10
12
  from ..program.raw_program import RawProgram, RawProgramFunction
11
13
  from ..utils.iter_extras import multiply, first
12
14
  from ..utils.np_extras import NDArrayNumeric, DTypeNumeric
13
- from .support.circuit_analyser import CircuitAnalysis, analyze_circuit
14
- from .support.input_vars import InputVars, InferVars, infer_input_vars
15
15
 
16
16
  # index to a value array
17
17
  _VARS = 0
@@ -85,6 +85,15 @@ class InterpreterRawProgram(RawProgram):
85
85
  var_indices=tuple(var.idx for var in in_vars),
86
86
  )
87
87
 
88
+ def dump(self, *, prefix: str = '', indent: str = ' ', show_instructions: bool = True) -> None:
89
+ super().dump(prefix=prefix, indent=indent)
90
+ print(f'{prefix}number of instructions = {len(self.instructions)}')
91
+ if show_instructions:
92
+ print(f'{prefix}instructions:')
93
+ next_prefix: str = prefix + indent
94
+ for instruction in self.instructions:
95
+ print(f'{next_prefix}{instruction.to_str(self.var_indices, self.np_consts)}')
96
+
88
97
  def __getstate__(self):
89
98
  """
90
99
  Support for pickle.
@@ -123,7 +132,6 @@ def _make_instructions(
123
132
  analysis: CircuitAnalysis,
124
133
  dtype: DTypeNumeric,
125
134
  ) -> Tuple[Sequence[_Instruction], NDArrayNumeric]:
126
-
127
135
  # Store const values in a numpy array
128
136
  node_to_const_idx: Dict[int, int] = {
129
137
  id(node): i
@@ -216,9 +224,32 @@ class _ElementID:
216
224
  array: int # VARS, TMPS, CONSTS, RESULT
217
225
  index: int # index into the array
218
226
 
227
+ def to_str(self, var_indices: Sequence[int], consts: NDArrayNumeric) -> str:
228
+ if self.array == _VARS:
229
+ return f'var[{var_indices[self.index]}]'
230
+ elif self.array == _TMPS:
231
+ return f'tmp[{self.index}]'
232
+ elif self.array == _CONSTS:
233
+ return str(consts.item(self.index))
234
+ elif self.array == _RESULT:
235
+ return f'result[{self.index}]'
236
+ else:
237
+ return f'?[{self.index}]'
238
+
219
239
 
220
240
  @dataclass
221
241
  class _Instruction:
222
242
  operation: Callable
223
243
  args: Sequence[_ElementID]
224
244
  dest: _ElementID
245
+
246
+ def to_str(self, var_indices: Sequence[int], consts: NDArrayNumeric) -> str:
247
+ symbol: str
248
+ if self.operation is multiply:
249
+ symbol = 'mul'
250
+ elif self.operation == sum:
251
+ symbol = 'sum'
252
+ else:
253
+ symbol = '<?>'
254
+ args: str = ' '.join(elem.to_str(var_indices, consts) for elem in self.args)
255
+ return f'{self.dest.to_str(var_indices, consts)} = {symbol} {args}'