prodigy-ppl 0.1.0__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.
Files changed (347) hide show
  1. prodigy_ppl-0.1.0/.gitignore +152 -0
  2. prodigy_ppl-0.1.0/LICENSE +201 -0
  3. prodigy_ppl-0.1.0/PKG-INFO +120 -0
  4. prodigy_ppl-0.1.0/README.md +93 -0
  5. prodigy_ppl-0.1.0/pgfexamples/README.md +48 -0
  6. prodigy_ppl-0.1.0/pgfexamples/equivalence/loop_free/bernoulli.pgcl +4 -0
  7. prodigy_ppl-0.1.0/pgfexamples/equivalence/loop_free/bernoulli2.pgcl +4 -0
  8. prodigy_ppl-0.1.0/pgfexamples/equivalence/loop_free/dice_sampling.pgcl +9 -0
  9. prodigy_ppl-0.1.0/pgfexamples/equivalence/loop_free/dice_sampling2.pgcl +11 -0
  10. prodigy_ppl-0.1.0/pgfexamples/equivalence/loop_free/uniform_sampling.pgcl +4 -0
  11. prodigy_ppl-0.1.0/pgfexamples/equivalence/loop_free/uniform_sampling2.pgcl +12 -0
  12. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/17_die_even.pgcl +11 -0
  13. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/bit_flip_conditioning.pgcl +17 -0
  14. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/condand.pgcl +10 -0
  15. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/dep_bern.pgcl +12 -0
  16. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/endless_conditioning.pgcl +7 -0
  17. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/geometric.pgcl +9 -0
  18. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/geometric_observe.pgcl +11 -0
  19. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/geometric_shifted.pgcl +10 -0
  20. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/17_die_even_invariant.pgcl +15 -0
  21. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/bit_flip_conditioning_invariant.pgcl +33 -0
  22. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/condand_invariant.pgcl +16 -0
  23. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/dep_bern_invariant.pgcl +15 -0
  24. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/endless_conditioning_invariant.pgcl +6 -0
  25. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/geometric_invariant.pgcl +11 -0
  26. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/geometric_observe_invariant.pgcl +12 -0
  27. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/geometric_shifted_invariant.pgcl +12 -0
  28. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/ky_die_2_invariant.pgcl +20 -0
  29. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/ky_die_invariant.pgcl +38 -0
  30. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/n_geometric_invariant.pgcl +11 -0
  31. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/nested_while_invariant1.pgcl +16 -0
  32. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/nested_while_invariant2.pgcl +11 -0
  33. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/random_walk_invariant.pgcl +13 -0
  34. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/rejection_sampling_invariant.pgcl +7 -0
  35. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/running_paper_example_invariant.pgcl +11 -0
  36. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/sequential_loops_invariant1.pgcl +12 -0
  37. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/sequential_loops_invariant2.pgcl +13 -0
  38. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/skip_rejection_sampling_invariant.pgcl +7 -0
  39. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/invariants/trivial_iid_invariant.pgcl +11 -0
  40. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/ky_die.pgcl +35 -0
  41. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/ky_die_2.pgcl +19 -0
  42. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/n_geometric.pgcl +9 -0
  43. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/nested_while.pgcl +15 -0
  44. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/random_walk.pgcl +10 -0
  45. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/running_paper_example.pgcl +9 -0
  46. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/sequential_loops.pgcl +17 -0
  47. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/skip_rejection_sampling.pgcl +6 -0
  48. prodigy_ppl-0.1.0/pgfexamples/equivalence/loopy/trivial_iid.pgcl +12 -0
  49. prodigy_ppl-0.1.0/pgfexamples/independence/fuzzy_or.pgcl +47 -0
  50. prodigy_ppl-0.1.0/pgfexamples/independence/infinite_multiplication.pgcl +11 -0
  51. prodigy_ppl-0.1.0/pgfexamples/independence/many_variables.pgcl +72 -0
  52. prodigy_ppl-0.1.0/pgfexamples/independence/modgrade_fullyisolated.pgcl +26 -0
  53. prodigy_ppl-0.1.0/pgfexamples/independence/oblivious_transfer.pgcl +53 -0
  54. prodigy_ppl-0.1.0/pgfexamples/independence/private_information_retriveal.pgcl +68 -0
  55. prodigy_ppl-0.1.0/pgfexamples/independence/twocoins_fail.pgcl +10 -0
  56. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/burgler_alarm.pgcl +36 -0
  57. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/caesar.pgcl +25 -0
  58. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/conditioning_divergence.pgcl +10 -0
  59. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/digitRecognition.pgcl +15755 -0
  60. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/evidence1.pgcl +10 -0
  61. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/evidence2.pgcl +15 -0
  62. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/grass.pgcl +31 -0
  63. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/infer_geom_mix.pgcl +27 -0
  64. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/lin_regression_unbiased.pgcl +25 -0
  65. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/lucky_throw.pgcl +19 -0
  66. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/monty_hall_nested.pgcl +20 -0
  67. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/murder_mystery.pgcl +16 -0
  68. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/skip_lin_regression_biased.pgcl +25 -0
  69. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/telephone_operator.pgcl +19 -0
  70. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/twocoins.pgcl +17 -0
  71. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/conditioning/undefined_normalization.pgcl +4 -0
  72. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/dnd_handicap.pgcl +39 -0
  73. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/function.pgcl +7 -0
  74. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/fuzzy_or.pgcl +48 -0
  75. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/max.pgcl +24 -0
  76. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/monty_hall.pgcl +69 -0
  77. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/pi.pgcl +7 -0
  78. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/piranha.pgcl +22 -0
  79. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/poor_scale.pgcl +8 -0
  80. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/prob_collatz.pgcl +12 -0
  81. prodigy_ppl-0.1.0/pgfexamples/inference/loop_free/scalability.pgcl +9 -0
  82. prodigy_ppl-0.1.0/pgfexamples/inference/loopy/conditioning/dep_bern.pgcl +14 -0
  83. prodigy_ppl-0.1.0/pgfexamples/inference/loopy/conditioning/trivial_iid.pgcl +13 -0
  84. prodigy_ppl-0.1.0/pgfexamples/inference/loopy/skip_exceeding_sum.pgcl +13 -0
  85. prodigy_ppl-0.1.0/pgfexamples/inference/loopy/skip_geom_dist.pgcl +10 -0
  86. prodigy_ppl-0.1.0/pgfexamples/inference/loopy/skip_random_walk.pgcl +15 -0
  87. prodigy_ppl-0.1.0/pgfexamples/inference/loopy/uniform_sampling.pgcl +30 -0
  88. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/cond_and.pgcl +7 -0
  89. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/dueling_cowboys.pgcl +15 -0
  90. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/fast_dice_roller.pgcl +35 -0
  91. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/faulty_decrement.pgcl +7 -0
  92. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/geometric.pgcl +7 -0
  93. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/geometric_counter.pgcl +8 -0
  94. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/modulo_geometric.pgcl +10 -0
  95. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/nontermination.pgcl +8 -0
  96. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/random_walk.pgcl +7 -0
  97. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/random_walk_counter.pgcl +13 -0
  98. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/skip_sequential_loops.pgcl +12 -0
  99. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/subdist_enter.pgcl +7 -0
  100. prodigy_ppl-0.1.0/pgfexamples/invariant_synthesis/thirds_geometric.pgcl +22 -0
  101. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/conditioning/README.md +6 -0
  102. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/conditioning/noisy_geometric.pgcl +16 -0
  103. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/conditioning/rw_counter_observe.pgcl +20 -0
  104. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/coupon_collector.pgcl +18 -0
  105. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/dueling_cowboys.pgcl +14 -0
  106. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/escape_counter.pgcl +12 -0
  107. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/fast_dice_roller.pgcl +35 -0
  108. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/faulty_decrement.pgcl +6 -0
  109. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/gamblers_ruin_counter.pgcl +11 -0
  110. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/geometric.pgcl +6 -0
  111. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/geometric_counter.pgcl +7 -0
  112. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/hark_counterexample.pgcl +14 -0
  113. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/lossy_retransmission.pgcl +12 -0
  114. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/modulo_geometric.pgcl +9 -0
  115. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/nontermination.pgcl +6 -0
  116. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/random_walk.pgcl +6 -0
  117. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/random_walk_counter.pgcl +12 -0
  118. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/subdist_enter.pgcl +6 -0
  119. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/exact/thirds_geometric.pgcl +21 -0
  120. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/escape_counter.pgcl +13 -0
  121. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/escape_noisy.pgcl +13 -0
  122. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/escape_walk.pgcl +10 -0
  123. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/jump_counter.pgcl +13 -0
  124. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/quadrant_drift.pgcl +12 -0
  125. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/quadrant_timeout.pgcl +14 -0
  126. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/rw_counter_1120.pgcl +12 -0
  127. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/rw_counter_23.pgcl +15 -0
  128. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/rw_counter_35.pgcl +12 -0
  129. prodigy_ppl-0.1.0/pgfexamples/lower_bounds/sandwich/symmetric_noisy.pgcl +14 -0
  130. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/bit_flip_conditioning_generalized_parameter.pgcl +18 -0
  131. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/bit_flip_conditioning_parameter.pgcl +17 -0
  132. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/brp_obs_parameter.pgcl +13 -0
  133. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/dueling_cowboys_parameter.pgcl +13 -0
  134. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/geometric_observe_parameter.pgcl +12 -0
  135. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/geometric_parameter.pgcl +9 -0
  136. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/bit_flip_conditioning_generalized_parameter_invariant.pgcl +34 -0
  137. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/bit_flip_conditioning_parameter_invariant.pgcl +36 -0
  138. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/brp_obs_parameter_invariant.pgcl +47 -0
  139. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/dueling_cowboys_parameter_invariant.pgcl +19 -0
  140. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/geometric_observe_parameter_invariant.pgcl +12 -0
  141. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/geometric_parameter_invariant.pgcl +12 -0
  142. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/ky_die_parameter_invariant.pgcl +40 -0
  143. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/n_geometric_parameter_invariant.pgcl +12 -0
  144. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/negative_binomial_parameter_invariant.pgcl +13 -0
  145. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/negative_binomial_reversed_parameter_invariant.pgcl +13 -0
  146. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/invariants/random_walk_parameter_invariant.pgcl +13 -0
  147. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/ky_die_parameter.pgcl +35 -0
  148. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/n_geometric_parameter.pgcl +10 -0
  149. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/negative_binomial_parameter.pgcl +14 -0
  150. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/negative_binomial_reversed_parameter.pgcl +14 -0
  151. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/random_walk_parameter.pgcl +11 -0
  152. prodigy_ppl-0.1.0/pgfexamples/template_parameter_synthesis/telephone_operator_parameter.pgcl +19 -0
  153. prodigy_ppl-0.1.0/prodigy/__init__.py +0 -0
  154. prodigy_ppl-0.1.0/prodigy/analysis/__init__.py +36 -0
  155. prodigy_ppl-0.1.0/prodigy/analysis/ai_candidates.py +227 -0
  156. prodigy_ppl-0.1.0/prodigy/analysis/analyzer.py +161 -0
  157. prodigy_ppl-0.1.0/prodigy/analysis/config.py +98 -0
  158. prodigy_ppl-0.1.0/prodigy/analysis/equivalence/__init__.py +9 -0
  159. prodigy_ppl-0.1.0/prodigy/analysis/equivalence/equivalence_check.py +151 -0
  160. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/__init__.py +0 -0
  161. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/__init__.py +0 -0
  162. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/__init__.py +0 -0
  163. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/dominat_root_rejection.py +58 -0
  164. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/heuristics_factory.py +25 -0
  165. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/individual_sum_terms.py +31 -0
  166. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/iterate_terms.py +39 -0
  167. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/logical.py +51 -0
  168. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/polynomial_positivity.py +24 -0
  169. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/positivity.py +31 -0
  170. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/positivity/rational_function.py +116 -0
  171. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/strategies.py +115 -0
  172. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/templates/__init__.py +0 -0
  173. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/templates/polynomial_function.py +40 -0
  174. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/templates/rational_function.py +36 -0
  175. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/templates/templates.py +13 -0
  176. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/heuristics/templates/templates_factory.py +14 -0
  177. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/invariant_synthesis.py +100 -0
  178. prodigy_ppl-0.1.0/prodigy/analysis/evtinvariants/invariant_verification.py +95 -0
  179. prodigy_ppl-0.1.0/prodigy/analysis/exceptions.py +26 -0
  180. prodigy_ppl-0.1.0/prodigy/analysis/independence/__init__.py +10 -0
  181. prodigy_ppl-0.1.0/prodigy/analysis/independence/independence.py +170 -0
  182. prodigy_ppl-0.1.0/prodigy/analysis/independence/utils.py +50 -0
  183. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/__init__.py +9 -0
  184. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/assignment_handler.py +50 -0
  185. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/function_handler.py +67 -0
  186. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/instruction_handler.py +29 -0
  187. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/ite_handler.py +58 -0
  188. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/loop_handler.py +36 -0
  189. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/observe_handler.py +39 -0
  190. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/probchoice_handler.py +38 -0
  191. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/program_info.py +28 -0
  192. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/query_handler.py +208 -0
  193. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/queryblock_handler.py +62 -0
  194. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/sample_handler.py +91 -0
  195. prodigy_ppl-0.1.0/prodigy/analysis/instructionhandler/while_handler.py +793 -0
  196. prodigy_ppl-0.1.0/prodigy/analysis/loop_strategies.py +326 -0
  197. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/__init__.py +0 -0
  198. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/egcalc.py +621 -0
  199. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/explicit.py +207 -0
  200. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/ir.py +152 -0
  201. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/parameters.py +539 -0
  202. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/problem.py +168 -0
  203. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/sandwich.py +418 -0
  204. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/subinvariant.py +207 -0
  205. prodigy_ppl-0.1.0/prodigy/analysis/lowerbounds/synthesis.py +344 -0
  206. prodigy_ppl-0.1.0/prodigy/analysis/optimization/__init__.py +9 -0
  207. prodigy_ppl-0.1.0/prodigy/analysis/optimization/gf_optimizer.py +59 -0
  208. prodigy_ppl-0.1.0/prodigy/analysis/optimization/optimizer.py +32 -0
  209. prodigy_ppl-0.1.0/prodigy/analysis/result.py +628 -0
  210. prodigy_ppl-0.1.0/prodigy/analysis/session.py +846 -0
  211. prodigy_ppl-0.1.0/prodigy/analysis/solver/__init__.py +0 -0
  212. prodigy_ppl-0.1.0/prodigy/analysis/solver/mock_solver.py +29 -0
  213. prodigy_ppl-0.1.0/prodigy/analysis/solver/smtz3_solver.py +131 -0
  214. prodigy_ppl-0.1.0/prodigy/analysis/solver/solver.py +13 -0
  215. prodigy_ppl-0.1.0/prodigy/analysis/solver/solver_type.py +18 -0
  216. prodigy_ppl-0.1.0/prodigy/analysis/solver/sympy_solver.py +65 -0
  217. prodigy_ppl-0.1.0/prodigy/cli.py +587 -0
  218. prodigy_ppl-0.1.0/prodigy/distribution/__init__.py +20 -0
  219. prodigy_ppl-0.1.0/prodigy/distribution/distribution.py +777 -0
  220. prodigy_ppl-0.1.0/prodigy/distribution/fast_generating_function.py +518 -0
  221. prodigy_ppl-0.1.0/prodigy/distribution/generating_function.py +1522 -0
  222. prodigy_ppl-0.1.0/prodigy/distribution/symengine_distribution.py +1142 -0
  223. prodigy_ppl-0.1.0/prodigy/pgcl/LICENSE +202 -0
  224. prodigy_ppl-0.1.0/prodigy/pgcl/NOTICE +9 -0
  225. prodigy_ppl-0.1.0/prodigy/pgcl/__init__.py +49 -0
  226. prodigy_ppl-0.1.0/prodigy/pgcl/ast/__init__.py +138 -0
  227. prodigy_ppl-0.1.0/prodigy/pgcl/ast/ast.py +10 -0
  228. prodigy_ppl-0.1.0/prodigy/pgcl/ast/declarations.py +148 -0
  229. prodigy_ppl-0.1.0/prodigy/pgcl/ast/expressions.py +425 -0
  230. prodigy_ppl-0.1.0/prodigy/pgcl/ast/instructions.py +218 -0
  231. prodigy_ppl-0.1.0/prodigy/pgcl/ast/program.py +145 -0
  232. prodigy_ppl-0.1.0/prodigy/pgcl/ast/types.py +68 -0
  233. prodigy_ppl-0.1.0/prodigy/pgcl/ast/walk.py +170 -0
  234. prodigy_ppl-0.1.0/prodigy/pgcl/check.py +729 -0
  235. prodigy_ppl-0.1.0/prodigy/pgcl/compiler.py +107 -0
  236. prodigy_ppl-0.1.0/prodigy/pgcl/parser.py +615 -0
  237. prodigy_ppl-0.1.0/prodigy/pgcl/pgcl_checks.py +55 -0
  238. prodigy_ppl-0.1.0/prodigy/pgcl/pgcl_operations.py +67 -0
  239. prodigy_ppl-0.1.0/prodigy/pgcl/pysmt/__init__.py +12 -0
  240. prodigy_ppl-0.1.0/prodigy/pgcl/pysmt/context.py +66 -0
  241. prodigy_ppl-0.1.0/prodigy/pgcl/pysmt/expr.py +124 -0
  242. prodigy_ppl-0.1.0/prodigy/pgcl/substitute.py +350 -0
  243. prodigy_ppl-0.1.0/prodigy/pgcl/util/__init__.py +32 -0
  244. prodigy_ppl-0.1.0/prodigy/pgcl/util/lark_expr_parser.py +134 -0
  245. prodigy_ppl-0.1.0/prodigy/pgcl/util/ref.py +166 -0
  246. prodigy_ppl-0.1.0/prodigy/util/__init__.py +89 -0
  247. prodigy_ppl-0.1.0/prodigy/util/color.py +19 -0
  248. prodigy_ppl-0.1.0/prodigy/util/logger.py +39 -0
  249. prodigy_ppl-0.1.0/prodigy/util/order.py +30 -0
  250. prodigy_ppl-0.1.0/prodigy/util/plotter.py +172 -0
  251. prodigy_ppl-0.1.0/prodigy/web/__init__.py +0 -0
  252. prodigy_ppl-0.1.0/prodigy/web/app.py +199 -0
  253. prodigy_ppl-0.1.0/prodigy/web/diagnostics.py +211 -0
  254. prodigy_ppl-0.1.0/prodigy/web/examples.py +189 -0
  255. prodigy_ppl-0.1.0/prodigy/web/frontend/README.md +15 -0
  256. prodigy_ppl-0.1.0/prodigy/web/frontend/build.mjs +35 -0
  257. prodigy_ppl-0.1.0/prodigy/web/frontend/codemirror-entry.js +64 -0
  258. prodigy_ppl-0.1.0/prodigy/web/frontend/package-lock.json +657 -0
  259. prodigy_ppl-0.1.0/prodigy/web/frontend/package.json +21 -0
  260. prodigy_ppl-0.1.0/prodigy/web/jobs.py +316 -0
  261. prodigy_ppl-0.1.0/prodigy/web/requests.py +109 -0
  262. prodigy_ppl-0.1.0/prodigy/web/static/app/api.js +45 -0
  263. prodigy_ppl-0.1.0/prodigy/web/static/app/app.css +485 -0
  264. prodigy_ppl-0.1.0/prodigy/web/static/app/components/charts.js +133 -0
  265. prodigy_ppl-0.1.0/prodigy/web/static/app/components/dom.js +71 -0
  266. prodigy_ppl-0.1.0/prodigy/web/static/app/components/format.js +106 -0
  267. prodigy_ppl-0.1.0/prodigy/web/static/app/components/math.js +20 -0
  268. prodigy_ppl-0.1.0/prodigy/web/static/app/components/result-view.css +181 -0
  269. prodigy_ppl-0.1.0/prodigy/web/static/app/components/result-view.js +495 -0
  270. prodigy_ppl-0.1.0/prodigy/web/static/app/document.js +283 -0
  271. prodigy_ppl-0.1.0/prodigy/web/static/app/editor.js +244 -0
  272. prodigy_ppl-0.1.0/prodigy/web/static/app/library.js +100 -0
  273. prodigy_ppl-0.1.0/prodigy/web/static/app/main.js +544 -0
  274. prodigy_ppl-0.1.0/prodigy/web/static/app/setup.js +283 -0
  275. prodigy_ppl-0.1.0/prodigy/web/static/app/store.js +20 -0
  276. prodigy_ppl-0.1.0/prodigy/web/static/vendor/codemirror.js +13 -0
  277. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/LICENSE +21 -0
  278. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  279. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  280. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  281. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  282. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  283. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  284. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  285. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  286. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  287. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  288. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  289. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  290. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  291. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  292. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  293. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  294. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  295. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  296. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  297. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  298. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/katex.min.css +1 -0
  299. prodigy_ppl-0.1.0/prodigy/web/static/vendor/katex/katex.min.js +1 -0
  300. prodigy_ppl-0.1.0/prodigy/web/templates/app.html +124 -0
  301. prodigy_ppl-0.1.0/pyproject.toml +91 -0
  302. prodigy_ppl-0.1.0/tests/__init__.py +0 -0
  303. prodigy_ppl-0.1.0/tests/analysis/__init__.py +0 -0
  304. prodigy_ppl-0.1.0/tests/analysis/equivalence/__init__.py +0 -0
  305. prodigy_ppl-0.1.0/tests/analysis/equivalence/test_equivalence_check.py +192 -0
  306. prodigy_ppl-0.1.0/tests/analysis/handlers/__init__.py +0 -0
  307. prodigy_ppl-0.1.0/tests/analysis/handlers/test_assignment_handler.py +98 -0
  308. prodigy_ppl-0.1.0/tests/analysis/handlers/test_function_semantics.py +47 -0
  309. prodigy_ppl-0.1.0/tests/analysis/handlers/test_ite_handler.py +28 -0
  310. prodigy_ppl-0.1.0/tests/analysis/handlers/test_pchoice_handler.py +58 -0
  311. prodigy_ppl-0.1.0/tests/analysis/handlers/test_sample_handler.py +53 -0
  312. prodigy_ppl-0.1.0/tests/analysis/independence/__init__.py +0 -0
  313. prodigy_ppl-0.1.0/tests/analysis/independence/test_stochastic_independence.py +48 -0
  314. prodigy_ppl-0.1.0/tests/analysis/solvers/__init__.py +0 -0
  315. prodigy_ppl-0.1.0/tests/analysis/solvers/test_mock_solvers.py +28 -0
  316. prodigy_ppl-0.1.0/tests/analysis/test_ai_candidates.py +108 -0
  317. prodigy_ppl-0.1.0/tests/analysis/test_distribution_transformer.py +28 -0
  318. prodigy_ppl-0.1.0/tests/analysis/test_lowerbound_strategies.py +121 -0
  319. prodigy_ppl-0.1.0/tests/analysis/test_lowerbounds.py +265 -0
  320. prodigy_ppl-0.1.0/tests/analysis/test_session.py +231 -0
  321. prodigy_ppl-0.1.0/tests/conftest.py +31 -0
  322. prodigy_ppl-0.1.0/tests/distribution/GiNaC/__init__.py +0 -0
  323. prodigy_ppl-0.1.0/tests/distribution/GiNaC/test_fast_generating_function.py +264 -0
  324. prodigy_ppl-0.1.0/tests/distribution/GiNaC/test_new_update.py +237 -0
  325. prodigy_ppl-0.1.0/tests/distribution/__init__.py +0 -0
  326. prodigy_ppl-0.1.0/tests/distribution/symengine/__init__.py +0 -0
  327. prodigy_ppl-0.1.0/tests/distribution/symengine/test_symengine.py +737 -0
  328. prodigy_ppl-0.1.0/tests/distribution/symengine/test_update.py +219 -0
  329. prodigy_ppl-0.1.0/tests/distribution/sympy/__init__.py +0 -0
  330. prodigy_ppl-0.1.0/tests/distribution/sympy/test_PGFS_factory.py +53 -0
  331. prodigy_ppl-0.1.0/tests/distribution/sympy/test_generating_function.py +315 -0
  332. prodigy_ppl-0.1.0/tests/distribution/sympy/test_new_update.py +268 -0
  333. prodigy_ppl-0.1.0/tests/pgcl/__init__.py +0 -0
  334. prodigy_ppl-0.1.0/tests/pgcl/nesting/test_expr_walk.py +60 -0
  335. prodigy_ppl-0.1.0/tests/pgcl/nesting/test_function_parsing.py +249 -0
  336. prodigy_ppl-0.1.0/tests/pgcl/nesting/test_function_type_check.py +123 -0
  337. prodigy_ppl-0.1.0/tests/pgcl/nesting/test_inference_parsing.py +42 -0
  338. prodigy_ppl-0.1.0/tests/pgcl/nesting/test_query.py +15 -0
  339. prodigy_ppl-0.1.0/tests/pgcl/test_compile_checks.py +25 -0
  340. prodigy_ppl-0.1.0/tests/pgcl/test_lark_expr_parser.py +24 -0
  341. prodigy_ppl-0.1.0/tests/pgcl/test_operator_precedence.py +55 -0
  342. prodigy_ppl-0.1.0/tests/pgcl/test_parser.py +58 -0
  343. prodigy_ppl-0.1.0/tests/pgcl/test_pgcl.py +55 -0
  344. prodigy_ppl-0.1.0/tests/pgcl/test_substitution.py +82 -0
  345. prodigy_ppl-0.1.0/tests/pgcl/test_typechecking.py +119 -0
  346. prodigy_ppl-0.1.0/tests/web/__init__.py +0 -0
  347. prodigy_ppl-0.1.0/tests/web/test_app.py +113 -0
@@ -0,0 +1,152 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ testreport.xml
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ .python-version
87
+
88
+ # pipenv
89
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
91
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
92
+ # install all needed dependencies.
93
+ #Pipfile.lock
94
+
95
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
96
+ __pypackages__/
97
+
98
+ # Celery stuff
99
+ celerybeat-schedule
100
+ celerybeat.pid
101
+
102
+ # SageMath parsed files
103
+ *.sage.py
104
+
105
+ # Environments
106
+ .env
107
+ .venv
108
+ env/
109
+ venv/
110
+ ENV/
111
+ env.bak/
112
+ venv.bak/
113
+
114
+ # Spyder project settings
115
+ .spyderproject
116
+ .spyproject
117
+
118
+ # Rope project settings
119
+ .ropeproject
120
+
121
+ # mkdocs documentation
122
+ /site
123
+
124
+ # mypy
125
+ .mypy_cache/
126
+ .dmypy.json
127
+ dmypy.json
128
+
129
+ # Pyre type checker
130
+ .pyre/
131
+
132
+ # VSCode
133
+ .vscode
134
+
135
+ # JetBrains
136
+ .idea
137
+
138
+ # Poetry
139
+ poetry.lock
140
+
141
+ # Benchmark script
142
+ *.csv
143
+ *.txt
144
+ *.md
145
+ !README.md
146
+ !CLAUDE.md
147
+ !docs/*.md
148
+ !prodigy/web/frontend/README.md
149
+
150
+ # Web GUI: npm packages for rebuilding the vendored libraries
151
+ prodigy/web/frontend/node_modules/
152
+
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [2022] [Lutz Klinkenberg]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.5
2
+ Name: prodigy-ppl
3
+ Version: 0.1.0
4
+ Summary: PRObability DIstributions via GeneratingfunctionologY: analysis of probabilistic programs with generating functions
5
+ Project-URL: Repository, https://github.com/LKlinke/Prodigy
6
+ Author-email: Lutz Klinkenberg <lutz.klinkenberg@cs.rwth-aachen.de>
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: algebraic-data-types<0.3,>=0.1.3
10
+ Requires-Dist: attrs>=19.3.0
11
+ Requires-Dist: click<9,>=8.1
12
+ Requires-Dist: flask<4,>=3.0
13
+ Requires-Dist: frozendict<3,>=2.3
14
+ Requires-Dist: lark<2,>=1.2
15
+ Requires-Dist: matplotlib<4,>=3.4.2
16
+ Requires-Dist: networkx<4,>=3.2
17
+ Requires-Dist: numpy>=1.26
18
+ Requires-Dist: pysmt<0.10,>=0.9.0
19
+ Requires-Dist: python-flint>=0.6
20
+ Requires-Dist: scipy>=1.11
21
+ Requires-Dist: setuptools<85,>=76.0.0
22
+ Requires-Dist: symengine<0.15,>=0.14.0
23
+ Requires-Dist: sympy<2,>=1.8
24
+ Provides-Extra: ginac
25
+ Requires-Dist: pygin>=1.0; extra == 'ginac'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # prodigy: PRObability DIstributions via GeneratingfunctionologY
29
+
30
+ prodigy is a prototypical tool for the analysis of probabilistic non-negative integer programs with `while`-loops. It is based on (probability) generating functions.
31
+
32
+ It provides a command-line interface and a web GUI.
33
+
34
+ ## Contents
35
+
36
+ 1. Installation
37
+ 2. Basic Usage
38
+
39
+
40
+ ## Installation
41
+
42
+ ### With pip
43
+
44
+ Prodigy is on PyPI as `prodigy-ppl` (the command and the Python package are called `prodigy`):
45
+
46
+ ```bash
47
+ pip install prodigy-ppl
48
+ ```
49
+
50
+ This needs Python 3.11 or newer and uses the SymPy and SymEngine engines. For the faster GiNaC engine (`--engine ginac`),
51
+ install [GiNaC](https://www.ginac.de/Download.html) and its Python bindings first (they are not on PyPI), then the extra:
52
+
53
+ ```bash
54
+ pip install "pygin @ git+https://github.com/LKlinke/prodigy-ginac-bindings.git@dynamic-variables"
55
+ pip install "prodigy-ppl[ginac]"
56
+ ```
57
+
58
+ ### With Docker
59
+
60
+ The image contains the command line and the web GUI with the SymPy and SymEngine engines, for amd64 and arm64
61
+ (tags: version, e.g. `3.1.0`, minor version `3.1`, and `latest`). Without arguments it starts the web GUI on
62
+ http://localhost:8080:
63
+
64
+ ```bash
65
+ docker run --rm -p 8080:8080 ghcr.io/lklinke/prodigy
66
+ ```
67
+
68
+ Arguments are passed to `prodigy`; mount the folder with your programs to use the command line:
69
+
70
+ ```bash
71
+ docker run --rm -v "$PWD":/work ghcr.io/lklinke/prodigy main /work/example.pgcl
72
+ ```
73
+
74
+ `Dockerfile.artifact` builds the full environment for artifacts (all engines including GiNaC, the sources and
75
+ the development tools): `make docker-artifact`, then `docker run -ti prodigy-artifact`.
76
+
77
+ ### From source
78
+
79
+ To install Prodigy from the repository, follow these steps:
80
+
81
+ 1. Make sure [Python](https://www.python.org/downloads/) 3.11 or newer is installed (tested with 3.11 and 3.14).
82
+ 2. Install [GiNaC](https://www.ginac.de/Download.html), which also requires [CLN](https://www.ginac.de/CLN/).
83
+ 3. Install [uv](https://docs.astral.sh/uv/getting-started/installation/).
84
+ 4. Clone or download the Prodigy repository, open a command prompt in its root folder, and type `./install.sh`. This installs Prodigy with the dependency versions locked in `uv.lock` into `.venv`, and the Z3 solver for pysmt.
85
+
86
+ If no errors occurred, you have successfully installed Prodigy.
87
+ Now there are two options on how to use the tool. You can either use the command-line interface (CLI) or the web GUI. The next section (_Basic Usage_) details how to achieve both of these things.
88
+
89
+ ### Troubleshooting
90
+
91
+ If you run into trouble during installation, this subsection might be of help. It lists some common problems that might occur during installation of Prodigy and how you can (hopefully) solve them.
92
+
93
+ - If you're using Windows, don't (not even WSL). We heavily recommend using either Linux or MacOS, as some of the required libraries have compatibility problems with Windows.
94
+ - If you're using Linux, make sure all of these packages are installed (if you're not using a Debian/Ubuntu based distribution, these might differ slightly):
95
+ - `CMake`
96
+ - `pkg-config`
97
+ - `build-essential` (includes `make`, `g++`, `gcc`, and more)
98
+ - `python3-dev` (called `python3-devel` on some other package managers such as `yam`)
99
+
100
+ ## Basic Usage
101
+ ### CLI
102
+
103
+ 1. In the project directory, run prodigy with ``uv run prodigy ...`` (or activate the virtual environment with ``source .venv/bin/activate`` and type ``prodigy ...``).
104
+ 2. For more information, see the help message (``uv run prodigy --help``) or have a look into the documentation.
105
+
106
+
107
+ ### Web GUI
108
+ 1. Type ``uv run prodigy web`` (or ``uv run prodigy --engine ginac web`` for the faster GiNaC engine). The GUI opens in your browser.
109
+ 2. Write or load a program, choose a strategy for each loop under *Setup*, and press *Analyze* (⌘/Ctrl + Return).
110
+
111
+ Results come with their guarantee (exact, lower bound with residual mass, upper bound), and
112
+ queries are answered with sound intervals. See [docs/gui.md](docs/gui.md), which also
113
+ describes the non-interactive analysis API (`prodigy analyze --json`).
114
+
115
+ ## Development
116
+
117
+ - `make lint`, `make mypy` and `make test` run the checks of the CI (pylint, mypy, and the tests with coverage; see `.github/workflows/main.yml`).
118
+ - `uv sync` installs pygin (GiNaC) from GitHub through the dependency group `ginac`; the package on PyPI does not depend on it.
119
+ - Releases: bump `version` in `pyproject.toml`, merge, and push a tag `v<version>` (e.g. `v3.1.0`). `.github/workflows/release.yml` runs the checks, waits for approval in the environment `release`, and publishes to PyPI, the Docker image (`Dockerfile`) to ghcr.io, and a GitHub release.
120
+ - Dependencies are locked in `uv.lock`. After changing them in `pyproject.toml`, run `uv lock` and commit both files. `uv lock --upgrade` updates all dependencies within their constraints; Dependabot proposes such updates monthly as pull requests.
@@ -0,0 +1,93 @@
1
+ # prodigy: PRObability DIstributions via GeneratingfunctionologY
2
+
3
+ prodigy is a prototypical tool for the analysis of probabilistic non-negative integer programs with `while`-loops. It is based on (probability) generating functions.
4
+
5
+ It provides a command-line interface and a web GUI.
6
+
7
+ ## Contents
8
+
9
+ 1. Installation
10
+ 2. Basic Usage
11
+
12
+
13
+ ## Installation
14
+
15
+ ### With pip
16
+
17
+ Prodigy is on PyPI as `prodigy-ppl` (the command and the Python package are called `prodigy`):
18
+
19
+ ```bash
20
+ pip install prodigy-ppl
21
+ ```
22
+
23
+ This needs Python 3.11 or newer and uses the SymPy and SymEngine engines. For the faster GiNaC engine (`--engine ginac`),
24
+ install [GiNaC](https://www.ginac.de/Download.html) and its Python bindings first (they are not on PyPI), then the extra:
25
+
26
+ ```bash
27
+ pip install "pygin @ git+https://github.com/LKlinke/prodigy-ginac-bindings.git@dynamic-variables"
28
+ pip install "prodigy-ppl[ginac]"
29
+ ```
30
+
31
+ ### With Docker
32
+
33
+ The image contains the command line and the web GUI with the SymPy and SymEngine engines, for amd64 and arm64
34
+ (tags: version, e.g. `3.1.0`, minor version `3.1`, and `latest`). Without arguments it starts the web GUI on
35
+ http://localhost:8080:
36
+
37
+ ```bash
38
+ docker run --rm -p 8080:8080 ghcr.io/lklinke/prodigy
39
+ ```
40
+
41
+ Arguments are passed to `prodigy`; mount the folder with your programs to use the command line:
42
+
43
+ ```bash
44
+ docker run --rm -v "$PWD":/work ghcr.io/lklinke/prodigy main /work/example.pgcl
45
+ ```
46
+
47
+ `Dockerfile.artifact` builds the full environment for artifacts (all engines including GiNaC, the sources and
48
+ the development tools): `make docker-artifact`, then `docker run -ti prodigy-artifact`.
49
+
50
+ ### From source
51
+
52
+ To install Prodigy from the repository, follow these steps:
53
+
54
+ 1. Make sure [Python](https://www.python.org/downloads/) 3.11 or newer is installed (tested with 3.11 and 3.14).
55
+ 2. Install [GiNaC](https://www.ginac.de/Download.html), which also requires [CLN](https://www.ginac.de/CLN/).
56
+ 3. Install [uv](https://docs.astral.sh/uv/getting-started/installation/).
57
+ 4. Clone or download the Prodigy repository, open a command prompt in its root folder, and type `./install.sh`. This installs Prodigy with the dependency versions locked in `uv.lock` into `.venv`, and the Z3 solver for pysmt.
58
+
59
+ If no errors occurred, you have successfully installed Prodigy.
60
+ Now there are two options on how to use the tool. You can either use the command-line interface (CLI) or the web GUI. The next section (_Basic Usage_) details how to achieve both of these things.
61
+
62
+ ### Troubleshooting
63
+
64
+ If you run into trouble during installation, this subsection might be of help. It lists some common problems that might occur during installation of Prodigy and how you can (hopefully) solve them.
65
+
66
+ - If you're using Windows, don't (not even WSL). We heavily recommend using either Linux or MacOS, as some of the required libraries have compatibility problems with Windows.
67
+ - If you're using Linux, make sure all of these packages are installed (if you're not using a Debian/Ubuntu based distribution, these might differ slightly):
68
+ - `CMake`
69
+ - `pkg-config`
70
+ - `build-essential` (includes `make`, `g++`, `gcc`, and more)
71
+ - `python3-dev` (called `python3-devel` on some other package managers such as `yam`)
72
+
73
+ ## Basic Usage
74
+ ### CLI
75
+
76
+ 1. In the project directory, run prodigy with ``uv run prodigy ...`` (or activate the virtual environment with ``source .venv/bin/activate`` and type ``prodigy ...``).
77
+ 2. For more information, see the help message (``uv run prodigy --help``) or have a look into the documentation.
78
+
79
+
80
+ ### Web GUI
81
+ 1. Type ``uv run prodigy web`` (or ``uv run prodigy --engine ginac web`` for the faster GiNaC engine). The GUI opens in your browser.
82
+ 2. Write or load a program, choose a strategy for each loop under *Setup*, and press *Analyze* (⌘/Ctrl + Return).
83
+
84
+ Results come with their guarantee (exact, lower bound with residual mass, upper bound), and
85
+ queries are answered with sound intervals. See [docs/gui.md](docs/gui.md), which also
86
+ describes the non-interactive analysis API (`prodigy analyze --json`).
87
+
88
+ ## Development
89
+
90
+ - `make lint`, `make mypy` and `make test` run the checks of the CI (pylint, mypy, and the tests with coverage; see `.github/workflows/main.yml`).
91
+ - `uv sync` installs pygin (GiNaC) from GitHub through the dependency group `ginac`; the package on PyPI does not depend on it.
92
+ - Releases: bump `version` in `pyproject.toml`, merge, and push a tag `v<version>` (e.g. `v3.1.0`). `.github/workflows/release.yml` runs the checks, waits for approval in the environment `release`, and publishes to PyPI, the Docker image (`Dockerfile`) to ghcr.io, and a GitHub release.
93
+ - Dependencies are locked in `uv.lock`. After changing them in `pyproject.toml`, run `uv lock` and commit both files. `uv lock --upgrade` updates all dependencies within their constraints; Dependabot proposes such updates monthly as pull requests.
@@ -0,0 +1,48 @@
1
+ # Examples
2
+
3
+ The examples are structured as follows:
4
+
5
+ ```
6
+ pgfexamples/
7
+ ├── equivalence # Equivalence of two programs
8
+ │   ├── loop_free # Programs without loops and their counterparts
9
+ │   └── loopy # Programs with loops
10
+ │   └── invariants # ... and their loop-free counterpart
11
+ ├── independence # Checks for independent variables
12
+ ├── inference # Calculation of posterior distribution
13
+ │   ├── loop_free # ... without while-loops
14
+ │   │   └── conditioning # ... with observe-statements
15
+ │   └── loopy # ... with while-loops
16
+ │   └── conditioning # ... with observe-statements
17
+ ├── invariant_synthesis # Synthesis of (expected visiting time) invariants
18
+ └── template_parameter_synthesis # Equality of loopy and loop-free programs with parameters
19
+ └── invariants # Corresponding loop-free programs
20
+ ```
21
+
22
+ ## File structure
23
+
24
+ * Files have a comment in the first line indicating which arguments should be used in order to execute it
25
+
26
+ > ```bash
27
+ >python prodigy/cli.py METHOD FILE ARGS
28
+ >```
29
+ > results in
30
+ >```
31
+ ># METHOD FILE ARGS
32
+ >```
33
+ > in the first line of the corresponding program or just
34
+ > ```
35
+ > # skip
36
+ > ```
37
+ > if the file should not be automatically tested.
38
+
39
+ * Naming convention:
40
+ * In `pgfexamples/equivalence/loop_free` the files are named `file_name.pgcl` for the first and
41
+ `file_name2.pgcl` for the second program
42
+ * In `pgfexamples/equivalence/loopy` and `pgfexamples/template_parameter_synthesis` the files are named
43
+ `file_name.pgcl` in the main folder and their corresponding invariants with `file_name_invariant.pgcl` in the
44
+ invariants folder
45
+ * If there are multiple invariant files for one program, e.g. for a nested loop, the invariants are to be marked
46
+ with numbers indicating the order they should be used (i.e. the invariant for the outer-most while loop has number
47
+ 1 and so on)
48
+ * Invariants and second programs are to be marked with `skip`
@@ -0,0 +1,4 @@
1
+ # check_equality pgfexamples/equivalence/loop_free/bernoulli.pgcl pgfexamples/equivalence/loop_free/bernoulli2.pgcl
2
+ nat x;
3
+
4
+ { x := 0 } [1/3] { x := 1 }
@@ -0,0 +1,4 @@
1
+ # skip
2
+ nat x;
3
+
4
+ x := bernoulli(2/3);
@@ -0,0 +1,9 @@
1
+ # check_equality pgfexamples/equivalence/loop_free/dice_sampling.pgcl pgfexamples/equivalence/loop_free/dice_sampling2.pgcl
2
+ nat dice;
3
+ nat tmp;
4
+
5
+ tmp := 0;
6
+
7
+ # Roll a dice
8
+ dice := unif(1,6);
9
+
@@ -0,0 +1,11 @@
1
+ # skip
2
+ nat dice;
3
+ nat tmp;
4
+
5
+ # Roll a three-sided dice
6
+ tmp := unif(1,3);
7
+
8
+ # Flip a coin, leave or increase by 3
9
+ { dice := tmp; } [1/2] { dice := tmp + 3; }
10
+
11
+ tmp := 0;
@@ -0,0 +1,4 @@
1
+ # check_equality pgfexamples/equivalence/loop_free/uniform_sampling.pgcl pgfexamples/equivalence/loop_free/uniform_sampling2.pgcl
2
+ nat x
3
+
4
+ x := unif(1,6)
@@ -0,0 +1,12 @@
1
+ # skip
2
+ nat x
3
+
4
+ {x:=1}[1/6]{
5
+ {x:=2}[1/5]{
6
+ {x:=3}[1/4]{
7
+ {x:=4}[1/3]{
8
+ {x:=5}[1/2]{x:=6}
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ # check_equality pgfexamples/equivalence/loopy/17_die_even.pgcl pgfexamples/equivalence/loopy/invariants/17_die_even_invariant.pgcl
2
+ nat c
3
+ nat x
4
+ nat temp
5
+
6
+ while (x < 6) {
7
+ x := unif(1,6)
8
+ c := c + 1
9
+ observe(x % 2 = 0)
10
+ temp := 0
11
+ }