34 class MyHypothesis final :
public Lexicon<MyHypothesis, S, InnerHypothesis, CL, CL, CLDatum> {
43 std::vector<SExpression::SExpNode> seen;
53 if(std::find(seen.begin(), seen.end(), xn) != seen.end()) {
69 for(
const auto& d : data) {
84 if((lhs == rhs) != (d.equal ==
true)) {
Definition: Combinators.h:75
Node & get_value()
Definition: LOTHypothesis.h:161
A lexicon stores an association of numbers (in a vector) to some other kind of hypotheses (typically ...
double likelihood
Definition: Bayesable.h:43
SExpression::SExpNode NodeToSExpNode(const Node &n)
Definition: Combinators.h:164
void set_value(Node &v)
Definition: InnerHypothesis.h:39
LOTHypothesis< InnerHypothesis, BindingTree *, bool, MyGrammar, grammar, defaultdatum_t< BindingTree *, bool >, std::vector< defaultdatum_t< BindingTree *, bool > >, typename MyGrammar ::VirtualMachineState_t > Super
Definition: DeterministicLOTHypothesis.h:17
virtual double compute_prior() override
Definition: MyHypothesis.h:40
Node SExpNodeToNode(const SExpression::SExpNode &n)
Definition: Combinators.h:181
void reduce(SExpression::SExpNode &n, int &remaining_calls)
Combinator reduction, assuming that n is a SExpNode.
Definition: Combinators.h:82
Definition: InnerHypothesis.h:9
double prior
Definition: Bayesable.h:42
A grammar for SK combinatory logic. NOTE: CustomOps must be defined here.
Definition: SExpression.h:20
void substitute(SExpression::SExpNode &n, const L &m)
Definition: Combinators.h:205
const double LL_PENALTY
Definition: Main.cpp:18
we don't need inputs/outputs for out MyHypothesis
Definition: MyHypothesis.h:6
constexpr double infinity
Definition: Numerics.h:20
Definition: DeterministicLOTHypothesis.h:14
std::vector< S > symbols
Definition: Main.cpp:15
SExpNode parse(std::vector< std::string > &tok)
Wrapper to parse to remove outer (...)
Definition: SExpression.h:172
double compute_likelihood(const data_t &data, const double breakout=-infinity) override
Compute the likelihood of a collection of data, by calling compute_single_likelihood on each...
Definition: MyHypothesis.h:64
virtual double compute_prior() override
Compute the prior – defaultly just the PCFG (grammar) prior.
Definition: LOTHypothesis.h:185
std::vector< Args... > data_t
Definition: Bayesable.h:39
InnerHypothesis(std::string s)
Definition: MyHypothesis.h:18