lppl  v2.0.0
effects.hpp File Reference
#include <cstddef>
#include <functional>
#include <unordered_map>
#include <record.hpp>

Functions

template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > apply_record_effect (pp_t< I, O, Ts... > &f, record_interpretation interp)
 
template<typename D , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > block (pp_t< I, O, Ts... > &&f, std::string address)
 
template<typename D , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > block (pp_t< I, O, Ts... > &f, std::string address)
 Converts the site at the passed address, if it exists, into untraced randomnes.
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > block_observe (pp_t< I, O, Ts... > &&f)
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > block_observe (pp_t< I, O, Ts... > &f)
 Blocks all observe sites. This could be useful for converting a probabilistic program into a proposal kernel.
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > block_sample (pp_t< I, O, Ts... > &&f)
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > block_sample (pp_t< I, O, Ts... > &f)
 Blocks all sample sites. This could be useful for performing a stochastic optimization task.
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > condition (pp_t< I, O, Ts... > &&f, std::string address, V value)
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > condition (pp_t< I, O, Ts... > &&f, std::unordered_map< std::string, V > &&map_)
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > condition (pp_t< I, O, Ts... > &f, std::string address, V value)
 Conditions the site at the address, if it exists, to be observed at the passed value.
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > condition (pp_t< I, O, Ts... > &f, std::unordered_map< std::string, V > map_)
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > replace (pp_t< I, O, Ts... > &&f)
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > replace (pp_t< I, O, Ts... > &f)
 Replaces probabilistic program-specified distributions with the distributions in any subsequently passed record.
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > replay (pp_t< I, O, Ts... > &&f)
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > replay (pp_t< I, O, Ts... > &&f, std::string address, V value)
 
template<typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > replay (pp_t< I, O, Ts... > &f)
 Replays any subsequently passed record through the program.
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > replay (pp_t< I, O, Ts... > &f, std::string address, V value)
 Replays the passed value through the model at the site at the passed address, if it exists.
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > set_in_place_effect (pp_t< I, O, Ts... > f, std::string address, V value, node_interpretation interp)
 
template<typename D , typename V , typename I , typename O , typename... Ts>
pp_t< I, O, Ts... > set_in_place_effect (pp_t< I, O, Ts... > f, std::unordered_map< std::string, V > map_, node_interpretation interp)
 

Detailed Description

This file is part of fmcs. Copyright David Rushing Dewhurst, 2022 - present. Some rights reserved.