# Inference Examples This notebook gives an overview of example programs for inference. Example files ending with =R= contain graphics elements produced by R. Examples divided by features: - Abduction: [eruption_abduction.pl](example/inference/eruption_abduction.pl), [abd_graph.pl](example/inference/abd_graph.pl) - MPE inference: [bag_mpe.pl](example/inference/bag_mpe.pl), [bag_game_mpe.pl](example/inference/bag_game_mpe.pl), [eruption_mpe.pl](example/inference/eruption_mpe.pl) - MAP inference: [bag_1.pl](example/inference/bag_1.pl) - Viterbi inference: [bag_game_vit.pl](example/inference/bag_game_vit.pl), [eruption_vit.pl](example/inference/eruption_vit.pl) - Tabling: [path_tabling.swinb](example/inference/path_tabling.swinb) - Causal inference: [simpson.swinb](example/inference/simpson.swinb), [viral.swinb](example/inference/viral.swinb) - Latent Dirichlet Allocation [lda.swinb](example/inference/lda.swinb) - Markov Logic Networks: [tile_mapcond.pl](example/inference/tile_mapcond.pl), [mln.swinb](example/inference/mln.swinb) - Gaussian process regression: [gpr.pl](example/inference/gpr.pl) - Dirichlet process: [dirichlet_process.pl](example/inference/dirichlet_process.pl), [dp_chinese.pl](example/inference/dp_chinese.pl), [dp_mix.pl](example/inference/dp_mix.pl) - continuous random variables: [diabetes.swinb](example/inference/diabetes.swinb), [ship.swinb](example/inference/ship.swinb), [fruit.swinb](example/inference/fruit.swinb), [lda.swinb](example/inference/lda.swinb), [gpr.pl](example/inference/gpr.pl), [gaussian_mixture.pl](example/inference/gaussian_mixture.pl), [kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl), [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl), [gaussian_mean_est.pl](example/inference/gauss_mean_est.pl), [seven_scientists.pl](example/inference/seven_scientists.pl), [widget.pl](example/inference/widget.pl), [widgetmsw.pl](example/inference/widgetmsw.pl), [indian_gpa.pl](example/inference/indian_gpa.pl), [indian_gpadc.pl](example/inference/indian_gpadc.pl), [nballs.pl](example/inference/nballs.pl), [nballsdc.pl](example/inference/nballsdc.pl), [dirichlet_process.pl](example/inference/dirichlet_process.pl), [dp_chinese.pl](example/inference/dp_chinese.pl), [dp_mix.pl](example/inference/dp_mix.pl), [figaro_product.swinb](example/figaro_product.swinb), [figaro_coin.swinb](example/figaro_coin.swinb), [figaro_coin_bag.swinb](example/figaro_coin_bag.swinb) - stochastic logic programs: [slp_pcfg.pl](example/inference/slp_pcfg.pl), [slp_pdcg.pl](example/inference/slp_pdcg.pl) - particle filtering: [kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl) - likelihood weighting: [gpr.pl](example/inference/gpr.pl), [kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl), [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl), [gaussian_mean_est.pl](example/inference/gauss_mean_est.pl), [seven_scientists.pl](example/inference/seven_scientists.pl), [widget.pl](example/inference/widget.pl), [widgetmsw.pl](example/inference/widgetmsw.pl), [indian_gpa.pl](example/inference/indian_gpa.pl), [indian_gpadc.pl](example/inference/indian_gpadc.pl), [nballs.pl](example/inference/nballs.pl), [nballsdc.pl](example/inference/nballsdc.pl), [figaro_coin.swinb](example/figaro_coin.swinb), [figaro_coin_bag.swinb](example/figaro_coin_bag.swinb) - Metropolis-Hastings sampling: [diabetes.swinb](example/inference/diabetes.swinb), [lda.swinb](example/inference/lda.swinb), [slp_pdcg.pl](example/inference/slp_pdcg.pl), [arithm.pl](example/inference/arithm.pl), [gaussian_mixture.pl](example/inference/gaussian_mixture.pl), [widget.pl](example/inference/widget.pl) [widgetmsw.pl](example/inference/widgetmsw.pl), - rejection sampling: [tile_mapcond.pl](example/inference/tile_mapcond.pl), [coinmc_R.pl](example/inference/coinmc_R.pl), [arithm.pl](example/inference/arithm.pl), [gaussian_mixture.pl](example/inference/gaussian_mixture.pl), [widget.pl](example/inference/widget.pl), [widgetmsw.pl](example/inference/widgetmsw.pl) - argument sampling: [tile_map.swinb](example/inference/tile_map.swinb), [tile_mapcond.pl](example/inference/tile_mapcond.pl), [lda.swinb](example/inference/lda.swinb), [random_walk.swinb](example/inference/random_walk.swinb), [coupon.swinb](example/inference/coupon.swinb), [gpr.pl](example/inference/gpr.pl), [dirichlet_process.pl](example/inference/dirichlet_process.pl), [dp_chinese.pl](example/inference/dp_chinese.pl), [dp_mix.pl](example/inference/dp_mix.pl), [markov_chain.pl](example/inference/markov_chain.pl), [plcg.pl](example/inference/plcg.pl), [hmmpos.swinb](example/inference/hmmpos.swinb), [hmmpos.pl](example/inference/hmmpos.pl), [hmmpos2.pl](example/inference/hmmpos2.pl), [arithm.pl](example/inference/arithm.pl), [gaussian_mixture.pl](example/inference/gaussian_mixture.pl), [kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl), [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl), [gaussian_mean_est.pl](example/inference/gauss_mean_est.pl), [seven_scientists.pl](example/inference/seven_scientists.pl), [widget.pl](example/inference/widget.pl), [widgetmsw.pl](example/inference/widgetmsw.pl), [slp_pcfg.pl](example/inference/slp_pcfg.pl), [slp_pdcg.pl](example/inference/slp_pdcg.pl), [binomial.pl](example/inference/binomial.pl) - variable number of objects: [var_objdb.pl](example/inference/var_objdb.pl), [var_obj.pl](example/inference/var_obj.pl), [var_obj_geom.pl](example/inference/var_obj_geom.pl) - flexible probabilities: [flexprob.pl](example/inference/flexprob.pl), [persons.pl](example/inference/persons.pl), [dirichlet_process.pl](example/inference/dirichlet_process.pl), [dp_chinese.pl](example/inference/dp_chinese.pl), [dp_mix.pl](example/inference/dp_mix.pl) - computation of expectations: [coupon.swinb](example/inference/coupon.swinb), [gpr.pl](example/inference/gpr.pl), [arithm.pl](example/inference/arithm.pl), [pctl_slep.pl](example/inference/pctl_slep.pl), [figaro_product.swinb](example/figaro_product.swinb), [figaro_coin.swinb](example/figaro_coin.swinb), [figaro_coin_bag.swinb](example/figaro_coin_bag.swinb) - infinite number of explanations: [random_walk.swinb](example/inference/random_walk.swinb), [coupon.swinb](example/inference/coupon.swinb), [pcfglrdb.pl](example/inference/pcfglrdb.pl), [pcfglr.pl](example/inference/pcfglr.pl), [markov_chaindb.pl](example/inference/markov_chaindb.pl), [slp_pcfg.pl](example/inference/slp_pcfg.pl) [markov_chain.pl](example/inference/markov_chain.pl), [prefix.pl](example/inference/prefix.pl), [var_objdb.pl](example/inference/var_objdb.pl), [var_obj.pl](example/inference/var_obj.pl), [var_obj_geom.pl](example/inference/var_obj_geom.pl), [plcg.pl](example/inference/plcg.pl), [pre_plcg.pl](example/inference/pre_plcg.pl), [pctl_slep.pl](example/inference/pctl_slep.pl), [gpl.pl](example/inference/gpl.pl), [rmc.pl](example/inference/rmc.pl), [arithm.pl](example/inference/arithm.pl), [truel.swinb](example/inference/truel.swinb), [truel.pl](example/inference/truel.pl) - meta probabilities: [meta.pl](example/inference/meta.pl) [metacomb.pl](example/inference/metacomb.pl) - combining rules: [metacomb.pl](example/inference/metacomb.pl) - graphics with R: [gpr_R.pl](example/inference/gpr_R.pl), [hmm_R.pl](example/inference/hmm_R.pl), [gaussian_mixture_R.pl](example/inference/gaussian_mixture_R.pl), [kalman_filter_R.pl](example/inference/kalman_filter_R.pl), [kalman_filtermsw_R.pl](example/inference/kalman_filtermsw_R.pl), [gaussian_mean_est_R.pl](example/inference/gauss_mean_est_R.pl), [seven_scientists_R.pl](example/inference/seven_scientists_R.pl), [widget_R.pl](example/inference/widget_R.pl), [widgetmsw_R.pl](example/inference/widgetmsw_R.pl), [dirichlet_process_R.pl](example/inference/dirichlet_process_R.pl), [dp_chinese_R.pl](example/inference/dp_chinese_R.pl), [dp_mix_R.pl](example/inference/dp_mix_R.pl), [alarm_R.pl](example/inference/alarm_R.pl), [arithm_R.pl](example/inference/arithm_R.pl), - graphics: [lda.swinb](example/inference/lda.swinb), [coupon.swinb](example/inference/coupon.swinb), [gpr.pl](example/inference/gpr.pl), [path_tabling.swinb](example/inference/path_tabling.swinb), [path.swinb](example/inference/path.swinb), [path.pl](example/inference/path.pl), [pctl_slep.pl](example/inference/pctl_slep.pl), [hmmpos.swinb](example/inference/hmmpos.swinb), [hmmpos.pl](example/inference/hmmpos.pl), [gaussian_mixture.pl](example/inference/gaussian_mixture.pl), [kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl), [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl), [gaussian_mean_est.pl](example/inference/gauss_mean_est.pl), [seven_scientists.pl](example/inference/seven_scientists.pl), [widget.pl](example/inference/widget.pl), [widgetmsw.pl](example/inference/widgetmsw.pl), [dirichlet_process.pl](example/inference/dirichlet_process.pl), [dp_chinese.pl](example/inference/dp_chinese.pl), [dp_mix.pl](example/inference/dp_mix.pl) - Monte Carlo unconditional inference: [diabetes.swinb](example/inference/diabetes.swinb), [ship.swinb](example/inference/ship.swinb), [fruit.swinb](example/inference/fruit.swinb), [tile_map.swinb](example/inference/tile_map.swinb), [tiny_event_calculusmc.pl](example/inference/tiny_event_calculusmc.pl), [random_walk.swinb](example/inference/random_walk.swinb), [coupon.swinb](example/inference/coupon.swinb), [coinmc.pl](example/inference/coinmc.pl), [pcfglr.pl](example/inference/pcfglr.pl), [markov_chain.pl](example/inference/markov_chain.pl), [prefix.pl](example/inference/prefix.pl), [var_obj.pl](example/inference/var_obj.pl), [var_obj_geom.pl](example/inference/var_obj_geom.pl), [plcg.pl](example/inference/plcg.pl), [pre_plcg.pl](example/inference/pre_plcg.pl), [pctl_slep.pl](example/inference/pctl_slep.pl), [gpl.pl](example/inference/gpl.pl), [rmc.pl](example/inference/rmc.pl), [hmmpos.swinb](example/inference/hmmpos.swinb), [hmmpos.pl](example/inference/hmmpos.pl), [hmmpos2.pl](example/inference/hmmpos2.pl), [dirichlet_process.pl](example/inference/dirichlet_process.pl), [dp_chinese.pl](example/inference/dp_chinese.pl), [dp_mix.pl](example/inference/dp_mix.pl) - conditional inference: [diabetes.swinb](example/inference/diabetes.swinb), [mln.swinb](example/inference/mln.swinb), [threesideddice.pl](example/inference/threesideddice.pl), [arithm.pl](example/inference/arithm.pl), [gaussian_mixture.pl](example/inference/gaussian_mixture.pl), [kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl), [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl), [gaussian_mean_est.pl](example/inference/gauss_mean_est.pl), [seven_scientists.pl](example/inference/seven_scientists.pl), [widget.pl](example/inference/widget.pl), [widgetmsw.pl](example/inference/widgetmsw.pl), [gpr.pl](example/inference/gpr.pl), [figaro_printer.swinb](example/figaro_printer.swinb), [figaro_coin.swinb](example/figaro_coin.swinb), [figaro_coin_bag.swinb](example/figaro_coin_bag.swinb) - unconditional inference: [diabetes.swinb](example/inference/diabetes.swinb), [ship.swinb](example/inference/ship.swinb), [fruit.swinb](example/inference/fruit.swinb), [tiny_event_calculus.pl](example/inference/tiny_event_calculus.pl), [coin.swinb](example/inference/coin.swinb), [coin.pl](example/inference/coin.pl), [coinmc.pl](example/inference/coinmc.pl), [dice.swinb](example/inference/dice.swinb), [dice.pl](example/inference/dice.pl), [epidemic.pl](example/inference/epidemic.pl), [earthquake.pl](example/inference/earthquake.pl), [sneezing.pl](example/inference/sneezing.pl), [eruption.pl](example/inference/eruption.pl), [mendel.pl](example/inference/mendel.pl), [bloodtype.pl](example/inference/bloodtype.pl), [path_tabling.swinb](example/inference/path_tabling.swinb), [path.swinb](example/inference/path.swinb), [path.pl](example/inference/path.pl), [alarm.pl](example/inference/alarm.pl), [hmm.pl](example/inference/hmm.pl), [pcfg.pl](example/inference/pcfg.pl), [uwcse.pl](example/inference/uwcse.pl), [cora.pl](example/inference/cora.pl), [mendelc.pl](example/inference/mendelc.pl), [meta.pl](example/inference/meta.pl) [metacomb.pl](example/inference/metacomb.pl), [flexprob.pl](example/inference/flexprob.pl), [persons.pl](example/inference/persons.pl), [pcfglrdb.pl](example/inference/pcfglrdb.pl), [pcfglr.pl](example/inference/pcfglr.pl), [markov_chaindb.pl](example/inference/markov_chaindb.pl), [markov_chain.pl](example/inference/markov_chain.pl), [prefix.pl](example/inference/prefix.pl), [testdb.pl](example/inference/testdb.pl), [var_objdb.pl](example/inference/var_objdb.pl), [var_obj.pl](example/inference/var_obj.pl), [var_obj_geom.pl](example/inference/var_obj_geom.pl), [plcg.pl](example/inference/plcg.pl), [pre_plcg.pl](example/inference/pre_plcg.pl), [pctl_slep.pl](example/inference/pctl_slep.pl), [gpl.pl](example/inference/gpl.pl), [rmc.pl](example/inference/rmc.pl), [hmmpos.swinb](example/inference/hmmpos.swinb), [hmmpos.pl](example/inference/hmmpos.pl), [hmmpos2.pl](example/inference/hmmpos2.pl), [truel.pl](example/inference/truel.pl), [truel.swinb](example/inference/truel.swinb), [dirichlet_process.pl](example/inference/dirichlet_process.pl), [dp_chinese.pl](example/inference/dp_chinese.pl), [dp_mix.pl](example/inference/dp_mix.pl), [figaro_product.swinb](example/figaro_product.swinb) - PRISM syntax: [coinmsw.pl](example/inference/coinmsw.pl), [widgetmsw.pl](example/inference/widgetmsw.pl), [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl) - Distributional clauses syntax: [indian_gpadc.pl](example/inference/indian_gpadc.pl), [nballsdc.pl](example/inference/nballsdc.pl) - Decision theory: [decision_theory.swinb](example/decision_theory.swinb) Examples divided by application domain: - reasoning about actions: [tiny_event_calculus.pl](example/inference/tiny_event_calculus.pl), [tiny_event_calculusmc.pl](example/inference/tiny_event_calculusmc.pl) - random walks: [random_walk.swinb](example/inference/random_walk.swinb), - marketing: [coupon.swinb](example/inference/coupon.swinb), [viral.swinb](example/inference/viral.swinb), [decision_theory.swinb](example/decision_theory.swinb) - natural language: [lda.swinb](example/inference/lda.swinb), [pcfg.pl](example/inference/pcfg.pl), [cora.pl](example/inference/cora.pl), [pcfglrdb.pl](example/inference/pcfglrdb.pl), [pcfglr.pl](example/inference/pcfglr.pl), [prefix.pl](example/inference/prefix.pl), [plcg.pl](example/inference/plcg.pl), [pre_plcg.pl](example/inference/pre_plcg.pl), [hmmpos.swinb](example/inference/hmmpos.swinb), [hmmpos.pl](example/inference/hmmpos.pl), [hmmpos2.pl](example/inference/hmmpos2.pl), [slp_pcfg.pl](example/inference/slp_pcfg.pl), [slp_pdcg.pl](example/inference/slp_pdcg.pl) - biology: [path_tabling.swinb](example/inference/path_tabling.swinb), [path.swinb](example/inference/path.swinb), [path.pl](example/inference/path.pl), [hmm.pl](example/inference/hmm.pl), - puzzles: [monty.swinb](example/inference/monty.swinb), [monty_general.swinb](example/inference/monty_general.swinb), [monty_simple.pl](example/inference/monty_simple.pl), [jail.swinb](example/inference/jail.swinb), [indian_gpa.pl](example/inference/indian_gpa.pl), [indian_gpadc.pl](example/inference/indian_gpadc.pl) - genetics: [mendel.pl](example/inference/mendel.pl), [bloodtype.pl](example/inference/bloodtype.pl), [mendelc.pl](example/inference/mendelc.pl), - model checking: [markov_chaindb.pl](example/inference/markov_chaindb.pl), [markov_chain.pl](example/inference/markov_chain.pl), [pctl_slep.pl](example/inference/pctl_slep.pl), [gpl.pl](example/inference/gpl.pl), [rmc.pl](example/inference/rmc.pl), - medicine: [simpson.swinb](example/inference/simpson.swinb), [epidemic.pl](example/inference/epidemic.pl), [sneezing.pl](example/inference/sneezing.pl), [diabetes.swinb](example/inference/diabetes.swinb) - games: [tile_map.swinb](example/inference/tile_map.swinb), [coin.swinb](example/inference/coin.swinb), [coin.pl](example/inference/coin.pl), [coinmc.pl](example/inference/coinmc.pl), [dice.swinb](example/inference/dice.swinb), [dice.pl](example/inference/dice.pl), [trigger.pl](example/inference/trigger.pl), [coin2.pl](example/inference/coin2.pl), [threesideddice.pl](example/inference/threesideddice.pl), [truel.swinb](example/inference/truel.swinb), [truel.pl](example/inference/truel.pl) - social networks: [mln.swinb](example/inference/mln.swinb), [uwcse.pl](example/inference/uwcse.pl), [figaro_product.swinb](example/figaro_product.swinb), [decision_theory.swinb](example/decision_theory.swinb) - filtering: [kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl), [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl) - Bayesian estimation: [gaussian_mean_est.pl](example/inference/gauss_mean_est.pl), [seven_scientists.pl](example/inference/seven_scientists.pl), [figaro_coin.swinb](example/figaro_coin.swinb), [figaro_coin_bag.swinb](example/figaro_coin_bag.swinb) - regression: [gpr.pl](example/inference/gpr.pl) - economy: [fruit.swinb](example/inference/fruit.swinb) - toy: [earthquake.pl](example/inference/earthquake.pl), [eruption.pl](example/inference/eruption.pl), [alarm.pl](example/inference/alarm.pl), [light.pl](example/inference/light.pl), [meta.pl](example/inference/meta.pl) [metacomb.pl](example/inference/metacomb.pl), [flexprob.pl](example/inference/flexprob.pl), [persons.pl](example/inference/persons.pl), [testdb.pl](example/inference/testdb.pl), [var_objdb.pl](example/inference/var_objdb.pl), [var_obj.pl](example/inference/var_obj.pl), [var_obj_geom.pl](example/inference/var_obj_geom.pl), [arithm.pl](example/inference/arithm.pl) - diagnosis: [figaro_printer.swinb](example/figaro_printer.swinb) - prediction: [ship.swinb](example/inference/ship.swinb) Complete list of examples with description: - Coin ([coin.swinb](example/inference/coin.swinb), [coin.pl](example/inference/coin.pl),[coin_R.pl](example/inference/coin_R.pl)) Throwing a coin with uncertainty on its fairness, from J. Vennekens, S. Verbaeten, and M. Bruynooghe. _Logic programs with annotated disjunctions_. In International Conference on Logic Programming, volume 3131 of LNCS, pages 195-209. Springer, 2004. [coinmc.pl](example/inference/coinmc.pl), [coinmc_R.pl](example/inference/coinmc_R.pl) are versions for inference with MCINTYRE (Monte Carlo sampling). [coinmsw.pl](example/inference/coinmsw.pl), [coinmsw_R.pl](example/inference/coinmsw_R.pl) is a version that models the problem with PRISM syntax. - Dice ([dice.swinb](example/inference/dice.swinb), [dice.pl](example/inference/dice.pl), [dice_R.pl](example/inference/dice_R.pl)) A six-sided die is repeatedly thrown until the outcome is six. From J. Vennekens, S. Verbaeten, and M. Bruynooghe. _Logic programs with annotated disjunctions_. In International Conference on Logic Programming, volume 3131 of LNCS, pages 195-209. Springer, 2004. - Epidemic ([epidemic.pl](example/inference/epidemic.pl), [epidemic_R.pl](example/inference/epidemic_R.pl)) Model of the development of an epidemic or a pandemic. From E. Bellodi and F. Riguzzi. _Expectation Maximization over binary decision diagrams for probabilistic logic programs_. Intelligent Data Analysis, 17(2):343-363, 2013. - Earthquake ([earthquake.pl](example/inference/earthquake.pl), [earthquake_R.pl](example/inference/earthquake_R.pl)) Occurrence of an earthquake depending on its possible causes. From F. Riguzzi and N. Di Mauro. _Applying the information bottleneck to statistical relational learning_. Machine Learning, 86(1):89-114, 2012. - Medical symptoms ([sneezing.pl](example/inference/sneezing.pl)) Effect of flu and hay fever on the sneezing symptom. From F. Riguzzi and T. Swift. _The PITA system: Tabling and answer subsumption for reasoning under uncertainty_. Theory and Practice of Logic Programming, 27th International Conference on Logic Programming (ICLP'11) Special Issue, 11(4-5), pages 433-449, 2011. - Eruption ([eruption.pl](example/inference/eruption.pl), [eruption_R.pl](example/inference/eruption_R.pl)) Occurrence of an eruption or an earthquake at Stromboli. From Elena Bellodi and Fabrizio Riguzzi. _Structure learning of probabilistic logic programs by searching the clause space_. Theory and Practice of Logic Programming, FirstView Articles, 2014. - Mendelian inheritance of the color of pea plants ([mendel.pl](example/inference/mendel.pl)) Mendelian inheritance of the color of pea plants. From H. Blockeel. _Probabilistic logical models for mendel's experiments: An exercise_. In Inductive Logic Programming, Work in Progress Track, 2004. - Mendelian inheritance of human bloodtype ([bloodtype.pl](example/inference/bloodtype.pl), [bloodtype_R.pl](example/inference/bloodtype_R.pl)) Mendelian inheritance of the bloodtype of people. The problem is to predict the probability of the bloodtype of a person. From Wannes Meert, Jan Struyf, and Hendrik Blockeel. _CP-Logic theory inference with contextual variable elimination and comparison to BDD based inference methods_. Inductive Logic Programming. Springer Berlin Heidelberg, 2010. - Path ([path.swinb](example/inference/path.swinb), [path.pl](example/inference/path.pl)) Computing the probability of a path between two nodes in a probabilistic graph. Each edge has a probability of being present. From L. De Raedt, A. Kimmig, and H. Toivonen. _ProbLog: A probabilistic Prolog and its application in link discovery_. In International Joint Conference on Artificial Intelligence, pages 2462-2467, 2007. By running the query graph(G) you can see a nice picture of the probabilistic graph. If the graph is undirected, you can use tabling to avoid going into an infinite loop: [path_tabling.swinb](example/inference/path_tabling.swinb) - Alarm Bayesian network ([alarm.pl](example/inference/alarm.pl), [alarm_R.pl](example/inference/alarm_R.pl)) The Alarm Bayesian network, from Figure 2 in J. Vennekens, S. Verbaeten, and M. Bruynooghe. _Logic programs with annotated disjunctions_. In International Conference on Logic Programming, volume 3131 of LNCS, pages 195-209. Springer, 2004. - Hidden Markov Model ([hmm.pl](example/inference/hmm.pl), [hmm_R.pl](example/inference/hmm_R.pl)) Hidden Markov model for modeling DNA sequences. The model has three states, q1, q2 and end, and four output symbols, a, c, g, and t, corresponding to the four nucleotides (letter). From Christiansen, H. and Gallagher, J. P. _Non-discriminating arguments and their uses_. In International Conference on Logic Programming. volume 5649 of LNCS, pages 55-69. Springer, 2009. - Probabilistic Context Free Grammar ([pcfg.pl](example/inference/pcfg.pl)) From Taisuke Sato and Keiichi Kubota. _Viterbi training in PRISM_. Theory and Practice of Logic Programming, doi:10.1017/S1471068413000677. - UWCSE: link prediction ([uwcse.pl](example/inference/uwcse.pl)) UWCSE university domain. From Wannes Meert, Jan Struyf, Hendrik Blockeel. _CP-Logic Theory Inference with Contextual Variable Elimination and Comparison to BDD Based Inference Methods_. Inductive Logic Programming, pages 96-109. Springer, 2010. - Cora: entity resolution ([cora.pl](example/inference/cora.pl), [cora_R.pl](example/inference/cora_R.pl)) The task is to compute the probability that two bibliographic citations refer to the same paper. From F. Riguzzi. _Speeding up inference for probabilistic logic programs_. The Computer Journal, 57(3):347-363, 2014 adapted from ([the Cora example in alchemy](http://alchemy.cs.washington.edu/)). - Monty Hall puzzle([monty.swinb](example/inference/monty.swinb), [monty_general.swinb](example/inference/monty_general.swinb) [monty_simple.pl](example/inference/monty_simple.pl)) From Chitta Baral, Michael Gelfond, and Nelson Rushton. _Probabilistic reasoning with answer sets_. Theory and Practice of Logic Programming 9(1), pages 57-144, 2009. - Three-prisoners puzzle ([jail.swinb](example/inference/jail.swinb)) From Peter D. Grunwald and Joseph Y. Halpern. _Updating Probabilities_. Journal of Artificial Intelligence Research 19, pages 243-278, 2003. - Russian roulette with two guns ([trigger.pl](example/inference/trigger.pl)) From J. Vennekens, Marc Denecker, and Maurice Bruynooghe. _CP-logic: A language of causal probabilistic events and its relation to logic programming_. Theory and Practice of Logic Programming, 9(3), pages 245-308, 2009. - Negation ([light.pl](example/inference/light.pl)) Example showing the use of negation. From J. Vennekens, Marc Denecker, and Maurice Bruynooghe. _CP-logic: A language of causal probabilistic events and its relation to logic programming_. Theory and Practice of Logic Programming, 9(3), pages 245-308, 2009. - Coins ([coin2.pl](example/inference/coin2.pl), [coin2_R.pl](example/inference/coin2_R.pl)) Throwing two coins with uncertainty on their fairness. From J. Vennekens, S. Verbaeten, and M. Bruynooghe. _Logic programs with annotated disjunctions_. In International Conference on Logic Programming, volume 3131 of LNCS, pages 195-209. Springer, 2004. - Three sided dice ([threesideddice.pl](example/inference/threesideddice.pl)) A three-sided die is repeatedly thrown until the outcome is three. From F. Riguzzi and T. Swift. _The PITA system: Tabling and answer subsumption for reasoning under uncertainty_. Theory and Practice of Logic Programming, 27th International Conference on Logic Programming (ICLP'11) Special Issue, 11(4-5), pages 433-449, 2011. [threesideddicemc.pl](example/inference/threesideddicemc.pl) is a version which adds the possibility of querying for the probability that the die lands on face 1 at least once. This query has an infinite number of explanations and MCINTYRE is required to answer it. - Mendelian inheritance of the color of pea plant - larger family ([mendelc.pl](example/inference/mendelc.pl)) From H. Blockeel. _Probabilistic logical models for mendel's experiments: An exercise_. In Inductive Logic Programming, Work in Progress Track, 2004. - Meta probabilities ([meta.pl](example/inference/meta.pl)) Probabilities computation in the body of probabilistic clauses (also called Nested probability computation). - Max combining rule ([metacomb.pl](example/inference/metacomb.pl)) Meta probabilities for implementing a max combining rule. From De Raedt, Luc, and Angelika Kimmig. _Probabilistic (logic) programming concepts_. Machine Learning (2015): 1-43. - Drawing balls from an urn ([flexprob.pl](example/inference/flexprob.pl)) Flexible probabilities (variable probabilistic annotations) that are instantiated at run time. From De Raedt, Luc, and Angelika Kimmig. _Probabilistic (logic) programming concepts_. Machine Learning (2015): 1-43. - Sampling persons ([persons.pl](example/inference/persons.pl)) The example models drawing a person at random from a population and computing the probability that it is a male or a female using flexible probabilities (variable probabilistic annotations). From J. Vennekens, S. Verbaeten, and M. Bruynooghe. _Logic programs with annotated disjunctions_. In International Conference on Logic Programming, volume 3131 of LNCS, pages 195-209. Springer, 2004. - Probabilistic Context Free Left Recursive Grammar. Since the grammar is left recursive, derivations may be infinite so the query may have an infinite number of explanations and PITA may not terminate. To ensure termination, a bound on the depth of the derivations of PITA can be imposed ([pcfglrdb.pl](example/inference/pcfglrdb.pl)), at the price of getting only a lower bound on the probability. Alternatively, MCINTYRE can be used ([pcfglr.pl](example/inference/pcfglr.pl), [pcfglr_R.pl](example/inference/pcfglr_R.pl)) that performs approximate inference by sampling and termination is ensured because the infinite branches have probability 0. From Taisuke Sato and Keiichi Kubota. _Viterbi training in PRISM_. Theory and Practice of Logic Programming, doi:10.1017/S1471068413000677. - Model checking of a Markov chain. We want to know what is the likelihood that on an execution of the chain from a start state _s_, a final state _t_ will be reached? The chains may be infinite so the query may have an infinite number of explanations and PITA may not terminate. To ensure termination, a bound on the depth of the derivations of PITA can be imposed ([markov_chaindb.pl](example/inference/markov_chaindb.pl)). Alternatively, MCINTYRE can be used ([markov_chain.pl](example/inference/markov_chain.pl), [markov_chain_R.pl](example/inference/markov_chain_R.pl)). From Gorlin, Andrey, C. R. Ramakrishnan, and Scott A. Smolka. _Model checking with probabilistic tabled logic programming._ Theory and Practice of Logic Programming 12.4-5 (2012). - Prefix probability computation ([prefix.pl](example/inference/prefix.pl), [prefix_R.pl](example/inference/prefix_R.pl)) Prefix parser for probabilistic context free grammars. The program computes the probability that a string is a prefix of a string genated by the grammar. From T. Sato, P. Meyer, _Tabling for infinite probability computation_, in: Inernational Conference on Logic Programming, Vol. 17 of LIPIcs, 2012, pp. 348-358. T. Sato, P. Meyer, _Infinite probability computation by cyclic explanation graphs_, Theory and Practice of Logic Programming 14 (2014) 909-937. doi:10.1017/S1471068413000562. - Querying a deterministic database ([testdb.pl](example/inference/testdb.pl)) Deterministic predicates can be defined outside `:-begin/end_lpad.` and queried in the body of probabilistic clauses. - Existence uncertainty/unknown objects. The programs models a domain where the number of objects is uncertain. In particular, the number of objects follows a geometric distribution with parameter 0.7. We can ask what is the probability that the object number n exists. The goal has an infinite number of explanations so we have to either set a depth bound ([var_objdb.pl](example/inference/var_objdb.pl)) or use approximate inference ([var_obj.pl](example/inference/var_obj.pl), [var_obj_R.pl](example/inference/var_obj_R.pl) with nonground facts and [var_obj_geom.pl](example/inference/var_obj_geom.pl), [var_obj_geom_R.pl](example/inference/var_obj_geom_R.pl) using the geometric distribution primitive). From Poole, David. _The independent choice logic and beyond._ Probabilistic inductive logic programming. Springer Berlin Heidelberg, 2008. 222-243. - Probabilistic Left-Corner Grammar ([plcg.pl](example/inference/plcg.pl), [plcg_R.pl](example/inference/plcg_R.pl)) A grammar using the rules of a context free grammar as a PCFG but using a shift-reduce parser with probabilities assigned to shift-reduce operations. Version with a left recursive grammar with MCINTYRE for inference. From Sato, Taisuke, Yoshitaka Kameya, and Kenichi Kurihara. _Variational Bayes via propositionalized probability computation in PRISM._ Annals of Mathematics and Artificial Intelligence 54.1-3 (2008): 135-158. - Prefix parser for a Probabilistic Left-Corner Grammar ([pre_plcg.pl](example/inference/pre_plcg.pl)) From T. Sato, P. Meyer, _Tabling for infinite probability computation_, in: Intnational Confence on Logic Programming, Vol. 17 of LIPIcs, 2012, pp. 348-358. T. Sato, P. Meyer, _Infinite probability computation by cyclic explanation graphs_, Theory and Practice of Logic Programming 14 (2014) 909-937. doi:10.1017/S1471068413000562. - Model checking of the Synchronous Leader Election Protocol expressed in Probabilistic Computation Tree Logic (PCTL). ([pctl_slep.pl](example/inference/pctl_slep.pl)) From Gorlin, Andrey, C. R. Ramakrishnan, and Scott A. Smolka. "Model checking with probabilistic tabled logic programming." Theory and Practice of Logic Programming 12.4-5 (2012): 681-700. This program was kindly provided by Andrey Gorlin and adapted to MCINTYRE by Fabrizio Riguzzi. - Model checker for fuzzy formulas in generalized probabilistic logic, an expressive logic based on the modal mu-calculus for probabilistic systems. ([gpl.pl](example/inference/gpl.pl)) From Gorlin, Andrey, C. R. Ramakrishnan, and Scott A. Smolka. "Model checking with probabilistic tabled logic programming." Theory and Practice of Logic Programming 12.4-5 (2012): 681-700. This program was kindly provided by Andrey Gorlin and adapted to MCINTYRE by Fabrizio Riguzzi. - Model checker for Recursive Markov Chains expressed in generalized probabilistic logic. ([rmc.pl](example/inference/rmc.pl)) From Gorlin, Andrey, C. R. Ramakrishnan, and Scott A. Smolka. "Model checking with probabilistic tabled logic programming." Theory and Practice of Logic Programming 12.4-5 (2012): 681-700. This program was kindly provided by Andrey Gorlin and adapted to MCINTYRE by Fabrizio Riguzzi. - Hidden Markov model for part-of-speech tagging. ([hmmpos.swinb](example/inference/hmmpos.swinb), [hmmpos.pl](example/inference/hmmpos.pl)) The states represent parts-of-speech, and the symbols emitted by the states are words. The assumption is that a word depends probabilistically on just its own part-of-speech (i.e. its tag) which in turn depends on the part-of-speech of the preceding word (or on the start state in case there is no preceding word). From http://www.ling.gu.se/~lager/Spaghetti/spaghetti.html Original program by Torbjorn Lager, adapted to MCINTYRE by Fabrizio Riguzzi. Argument sampling to approximately compute the Viterbi path (most probable tagging). - 1st- and 2nd-order Hidden Markov model for part-of-speech tagging ([hmmpos2.pl](example/inference/hmmpos2.pl)). This program differs from ([hmmpos.pl](example/inference/hmmpos.pl)) because 1. a 1st-order HMM and a 2nd-order HMM are included 2. the probabilistic predicates =trans/3=, =trans2/4=, =out/3= and =out2/4= are defined intensionally 3. the probability values are defined on the basis of frequency data from a (toy in this example) dataset From Joakim Nivre. "Logic programming tools for probabilistic part-of-speech tagging." Master's thesis, Vaxjo University, 2000. [[pdf](http://stp.lingfil.uu.se/~nivre/docs/thesis3.pdf)] Original program by Joakim Nivre and Torbjorn Lager, adapted to MCINTYRE by Fabrizio Riguzzi. - Random arithmetic function from http://forestdb.org/models/arithmetic.html ([arithm.pl](example/inference/arithm.pl), [arithm_R.pl](example/inference/arithm_R.pl)). The model generatively defines a random arithmetic function. The problem is to predict the value returned by the function given one or two couples of input-output, i.e., to compute a conditional probability. Translated from the Church functional probabilistic programming language. Sampling is necessary as queries have an infinite number of explanations. Both rejection sampling and Metropolis/Hastings can be applied. - Gaussian mixture model ([gaussian_mixture.pl](example/inference/gaussian_mixture.pl), [gaussian_mixture_R.pl](example/inference/gaussian_mixture_R.pl)). Mixture of two Gaussians. A biased coin is thrown, if it lands heads X in mix(X) is sampled from a Gaussian with mean 0 and variance 1. if it lands tails X is sampled from a Gaussian with mean 5 and variance 2. The example illustrates the use of continuous random variables and the use of sampling, including rejection sampling and Metropolis/Hastings. Moreover the example illustrates the use of the predicate histogram/3 for graphing the probability density function of continuous random variables. - One-dimensional Kalman filter ([kalman_filter.swinb](example/inference/kalman_filter.swinb), [kalman_filter.pl](example/inference/kalman_filter.pl), [kalman_filter_R.pl](example/inference/kalman_filter_R.pl), PRISM syntax [kalman_filtermsw.pl](example/inference/kalman_filtermsw.pl), [kalman_filterimsw_R.pl](example/inference/kalman_filtermsw_R.pl)). Hidden Markov model with a real value as state and a real value as output. The next state is given by the current state plus Gaussian noise (mean 0 and variance 2 in this example) and the output is given by the current state plus Gaussian noise (mean 0 and variance 1 in this example). Given that at time 0 the value 2.5 was observed, what is the distribution of the state at time 1 (filtering problem)? Liklihood weighing is used to condition the distribution on evidence on a continuous random variable (evidence with probability 0). CLP(R) constraints allow both sampling and weighing samples with the same program. From Islam, Muhammad Asiful, C. R. Ramakrishnan, and I. V. Ramakrishnan. "Inference in probabilistic logic programs with continuous random variables." Theory and Practice of Logic Programming 12.4-5 (2012): 505-523. http://arxiv.org/pdf/1112.2681v3.pdf Russell, S. and Norvig, P. 2010. Arficial Intelligence: A Modern Approach. Third Edition, Prentice Hall, Figure 15.10 page 587 - Posterior estimation in Bayesian models ([gaussian_mean_est.pl](example/inference/gauss_mean_est.pl), [gaussian_mean_est_R.pl](example/inference/gauss_mean_est_R.pl)). We are trying to estimate the true value of a Gaussian distributed random variable, given some observed data. The variance is known (2) and we suppose that the mean has a Gaussian distribution with mean 1 and variance 5. We take different measurement (e.g. at different times), indexed with an integer. Given that we observe 9 and 8 at indexes 1 and 2, how does the distribution of the random variable (value at index 0) changes with respect to the case of no observations? From http://www.robots.ox.ac.uk/~fwood/anglican/examples/viewer/?worksheet=gaussian-posteriors - Seven scientists, posterior estimation in Bayesian models ([seven_scientists.pl](example/inference/seven_scientists.pl), [seven_scientists_R.pl](example/inference/seven_scientists_R.pl)). Suppose seven scientists all go and perform the same experiment, each collecting a measurement xi for i=1,..,7. These scientists are varyingly good at their job, and while we can assume each scientist would estimate x correctly on average, some of them may have much more error in their measurements than others. They come back with the following seven observations: [-27.020 3.570 8.191 9.898 9.603 9.945 10.056] To model this situation, we put a prior on the mean and the standard deviation of the measurements each of the 7 scientists. For the mean, we use a Gaussian prior with mean 0 and variance 50^2. For the standard deviation, we use a uniform prior between 0 and 25. Given the above measurements, what is the posterior distribution of x? From http://www.robots.ox.ac.uk/~fwood/anglican/examples/viewer/?worksheet=gaussian-posteriors - Factory producing widgets ([widget.pl](example/inference/widget.pl), [widget_R.pl](example/inference/widget_R.pl), PRISM syntax [widgetmsw.pl](example/inference/widgetmsw.pl), [widgetmsw_R.pl](example/inference/widgetmsw_R.pl)). Consider a factory with two machines a and b. Each machine produces a widget with a continuous feature. A widget is produced by machine a with probability 0.7 and by machine b with probability b. If the widget is produced by machine a, the feature is distributed as a Gaussian with mean 2.0 and variance 1.0. If the widget is produced by machine b, the feature is distributed as a Gaussian with mean 3.0 and variance 1.0. The widget then is processed by a third machine that adds a random quantity to the feature distributed as a Gaussian with mean 0.5 and variance 1.5. What is the distribution of the feature? Adapted from Islam, Muhammad Asiful, C. R. Ramakrishnan, and I. V. Ramakrishnan. "Inference in probabilistic logic programs with continuous random variables." Theory and Practice of Logic Programming 12.4-5 (2012): 505-523. http://arxiv.org/pdf/1112.2681v3.pdf - Stochastic logic program ([slp_pcfg.pl](example/inference/slp_pcfg.pl)). Probabilistic context-free grammar implemented as a Stochastic Logic Program. SLPs define a distribution over arguments of goals. SLPs can be written as an LPAD/ProbLog program by recalling that in SLPs the probabilities of all rules with the same head predicate sum to one and define a mutually exclusive choice on how to continue a proof. Furthermore, repeated choices are independent, i.e., no stochastic memoization is done. - Stochastic logic program ([slp_pdcg.pl](example/inference/slp_pdcg.pl), [slp_pdcg_R.pl](example/inference/slp_pdcg_R.pl)). Program modeling an SLP defining a probabilistic definite clause grammar. Form https://dtai.cs.kuleuven.be/problog/tutorial/various/06_slp.html#stochastic-logic-programs - The Indian GPA Problem. ([indian_gpa.pl](example/inference/indian_gpa.pl), distributional clauses version [indian_gpadc.pl](example/inference/indian_gpadc.pl)). From http://www.robots.ox.ac.uk/~fwood/anglican/examples/viewer/?worksheet=indian-gpa "This example was inspired by Stuart Russell...the problem is: if you observe that a student GPA is exactly 4.04.0 in a model of transcripts of students from the USA (GPA's from 0.00.0 to 4.04.0 and India (GPA's from 0.00.0 to 10.010.0) what is the probability that the student is from India?... As we know from statistics, given the mixture distribution and given the fact that his/her GPA is exactly 4.04.0, the probability that the student is American must be 1.01.0 (i.e. zero probability that the student is from India)." Probabilistic logic program from https://github.com/davidenitti/DC/blob/master/examples/indian-gpa.pl - Urn and balls, distributional Clauses example. ([nballs.pl](example/inference/nballs.pl), distributional clauses syntax [nballsdc.pl](example/inference/nballsdc.pl)). From Example 4 of Davide Nitti, Tinne De Laet, and Luc De Raedt. Probabilistic logic programming for hybrid relational domains. Machine Learning 103(3), 407-449, 2016. http://link.springer.com/article/10.1007/s10994-016-5558-8/fulltext.html "We have an urn, where the number of balls n is a random variable and each ball X has a color, material, and size with a known distribution. The i-th ball drawn with replacement from the urn is named drawn(i)." See also https://github.com/davidenitti/DC/blob/master/examples/tutorial.pl - Truel, or duel among three opponents ([truel.swinb](example/inference/truel.swinb), [truel.pl](example/inference/truel.pl)). See https://en.wikipedia.org/wiki/Truel - Dirichlet process (DP) ([dirichlet_process.pl](example/inference/dirichlet_process.pl), [dirichlet_process_R.pl](example/inference/dirichlet_process_R.pl)) with a stick breaking process, see https://en.wikipedia.org/wiki/Dirichlet_process - Dirichlet process (DP) ([dp_chinese.pl](example/inference/dp_chinese.pl), [dp_chinese_R.pl](example/inference/dp_chinese_R.pl)) with a Chinese Restaurant Process, see https://en.wikipedia.org/wiki/Dirichlet_process - Mixture model from a Dirichlet process, ([dp_mix.pl](example/inference/dp_mix.pl), [dp_mix_R.pl](example/inference/dp_mix_R.pl)) see http://www.robots.ox.ac.uk/~fwood/anglican/examples/viewer/?worksheet=nonparametrics/dp-mixture-model https://en.wikipedia.org/wiki/Dirichlet_process - Gaussian process (GP) regression ([gpr.pl](example/inference/gpr.pl), [gpr_R.pl](example/inference/gpr_R.pl)) see https://en.wikipedia.org/wiki/Gaussian_process http://arxiv.org/pdf/1505.02965v2.pdf and Christopher M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006, section 6.4 - Markov Logic Networks ([mln.swinb](example/inference/mln.swinb)): how to represent MLNs with probabilistic logic programming - Coupon Collector Problem ([coupon.swinb](example/inference/coupon.swinb)) see Kaminski, B. L., Katoen, J.-P., Matheja, C., Olmedo, F., Weakest precondition reasoning for expected run-times of probabilistic programs. Programming languages and systems, LNCS, vol. 9632, pp. 364-389, Springer, Heidelberg (2016) - Random Walk ([random_walk.swinb](example/inference/random_walk.swinb)) see Kaminski, B. L., Katoen, J.-P., Matheja, C., Olmedo, F., Weakest precondition reasoning for expected run-times of probabilistic programs. Programming languages and systems, LNCS, vol. 9632, pp. 364-389, Springer, Heidelberg (2016) - Latent Dirichlet Allocation ([lda.swinb](example/inference/lda.swinb)) see https://en.wikipedia.org/wiki/Latent_Dirichlet_allocation and Blei, David M., Andrew Y. Ng, and Michael I. Jordan. "Latent dirichlet allocation." Journal of machine Learning research 3.Jan (2003): 993-1022. - Simpson's paradox ([simpson.swinb](example/inference/simpson.swinb)) see Pearl, Judea. Causality. Cambridge university press, 2009 - Viral marketing ([viral.swinb](example/inference/viral.swinb)). Computing the effects of marketing actions. - Reasoning about uncertain actions with the Event Calculus ([tiny_event_calculus.pl](example/inference/tiny_event_calculus.pl), [tiny_event_calculusmc.pl](example/inference/tiny_event_calculusmc.pl)) - Tile map generation ([tile_map.swinb](example/inference/tile_map.swinb), [tile_map.pl](example/inference/tile_map.pl), [tile_mapcond.pl](example/inference/tile_mapcond.pl)) - Binomial distribution ([binomial.pl](example/inference/binomial.pl)) - Figaro examples in PLP: printer diagnosis ([figaro_printer.swinb](example/figaro_printer.swinb)), predicting product success ([figaro_product.swinb](example/figaro_product.swinb)), estimating the bias of a coin ([figaro_coin.swinb](example/figaro_coin.swinb)) and estimating average bias of a bag of coins ([figaro_coin_bag.swinb](example/figaro_coin_bag.swinb)). From [A. Pfeffer, Practical Probabilistic Programming](https://www.manning.com/books/practical-probabilistic-programming) - Computation of the h-index ([h_index.pl](example/h_index.pl)). Computation of the h-index of an author given his number of papers assuming that the citations per paper follow a Poisson distribution with given average. - Computing the probability of success of an attack to the Bitcoin protocol ([bitcoin_attack.pl](example/bitcoin_attack.pl)). From Damiano Azzolini, Fabrizio Riguzzi, Evelina Lamma, Elena Bellodi, and Riccardo Zese. Modeling bitcoin protocols with probabilistic logic programming. PLP 2018 http://ceur-ws.org/Vol-2219/paper6.pdf - Computing the probability of mining the next block with a two-phase Proof-of-Work protocol in a Bitcoin network ([bitcoin_two_phase.pl](example/bitcoin_two_phase.pl)). From Damiano Azzolini, Fabrizio Riguzzi, Evelina Lamma, Elena Bellodi, and Riccardo Zese. Modeling bitcoin protocols with probabilistic logic programming. PLP 2018 http://ceur-ws.org/Vol-2219/paper6.pdf - Truncated Dirichlet process ([truncated_dirichlet_process.pl](example/truncated_dirichlet_process.pl)) Comparison of the Dirichlet distribution with a truncated Dirichlet process. - Fair coin from a biased coin ([von_neumann_trick.swinb](example/von_neumann_trick.swinb)) If you have a biased coin, obtain a fair coin using the von Neumann trick. - Red and Blue Hats Puzzle ([hats.swinb](example/hats.swinb)) From Aaronson, Scott. Quantum Computing Since Democritus. Cambridge university press, 2013 - Decision theory problems ([decision_theory.swinb](example/decision_theory.swinb)) from G. V. den Broeck, I. Thon, M. van Otterlo, L. D. Raedt, Dtproblog: A decision-theoretic probabilistic prolog, in: M. Fox, D. Poole (Eds.), 24th AAAI Conference on Artificial Intelligence, AAAI’10, Atlanta, Georgia, USA, July 11-15, 2010, AAAI Press, 2010, pp. 1217–1222. - Fruit selling example ([fruit.swinb](example/inference/fruit.swinb)) from Steffen Michels, Arjen Hommersom, Peter J. F. Lucas, Marina Velikova: A new probabilistic constraint logic programming language based on a generalised distribution semantics. Artif. Intell. 228: 1-44 (2015) - Fire on a ship example ([ship.swinb](example/inference/ship.swinb)) from Steffen Michels, Arjen Hommersom, Peter J. F. Lucas, Marina Velikova: A new probabilistic constraint logic programming language based on a generalised distribution semantics. Artif. Intell. 228: 1-44 (2015) - Diabetes mellitus type 2 example ([diabetes.swinb](example/inference/diabetes.swinb)) from Steffen Michels, Arjen Hommersom, Peter J. F. Lucas, Marina Velikova: A new probabilistic constraint logic programming language based on a generalised distribution semantics. Artif. Intell. 228: 1-44 (2015) - Drawing balls from an urn: examples for MPE/MAP inference, ([bag_mpe.pl](example/inference/bag_mpe.pl), [bag_1.pl](example/inference/bag_1.pl)). From Dimitar Shterionov, Joris Renkens, Jonas Vlasselaer, Angelika Kimmig, Wannes Meert, and Gerda Janssens. The most probable explanation for probabilistic logic programs with annotated disjunctions. In International Conference on Inductive Logic Programming, volume 9046 of LNCS, 139–153. 2015 - Drawing balls from an urn game: examples for MPE/Viterbi inference, ([bag_game_mpe.pl](example/inference/bag_game_mpe.pl), [bag_game_vit.pl](example/inference/bag_game_vit.pl)). These example show the difference between MPE and Viterbi inference. From Dimitar Shterionov, Joris Renkens, Jonas Vlasselaer, Angelika Kimmig, Wannes Meert, and Gerda Janssens. The most probable explanation for probabilistic logic programs with annotated disjunctions. In International Conference on Inductive Logic Programming, volume 9046 of LNCS, 139–153. 2015 - Eruption MPE and Viterbi inference ([eruption_mpe.pl](example/inference/eruption_mpe.pl), [eruption_vit.pl](example/inference/eruption_vit.pl)) Occurrence of an eruption or an earthquake at Stromboli. These example show the difference between MPE and Viterbi inference.