Stan  2.10.0
probability, sampling & optimization
semantic_actions.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_GRAMMARS_SEMANTIC_ACTIONS_HPP
2 #define STAN_LANG_GRAMMARS_SEMANTIC_ACTIONS_HPP
3 
4 #include <stan/lang/ast.hpp>
6 #include <boost/variant/recursive_variant.hpp>
7 #include <boost/spirit/include/qi.hpp>
8 #include <map>
9 #include <set>
10 #include <string>
11 #include <utility>
12 #include <vector>
13 
14 namespace stan {
15 
16  namespace lang {
17 
18  bool has_prob_suffix(const std::string& s);
19 
20  void replace_suffix(const std::string& old_suffix,
21  const std::string& new_suffix, fun& f);
22 
23  bool validate_double_expr(const expression& expr,
24  std::stringstream& error_msgs);
25 
26  void set_fun_type(fun& fun, std::ostream& error_msgs);
27 
28  int num_dimss(std::vector<std::vector<stan::lang::expression> >& dimss);
29 
39  template <class> struct result;
40 
45  template <typename F, typename T1>
46  struct result<F(T1)> { typedef void type; };
47  };
48 
58  template <class> struct result;
59 
64  template <typename F, typename T1, typename T2>
65  struct result<F(T1, T2)> { typedef void type; };
66  };
67 
77  template <class> struct result;
78 
83  template <typename F, typename T1, typename T2, typename T3>
84  struct result<F(T1, T2, T3)> { typedef void type; };
85  };
86 
96  template <class> struct result;
97 
102  template <typename F, typename T1, typename T2, typename T3, typename T4>
103  struct result<F(T1, T2, T3, T4)> { typedef void type; };
104  };
105 
115  template <class> struct result;
116 
121  template <typename F, typename T1, typename T2, typename T3,
122  typename T4, typename T5>
123  struct result<F(T1, T2, T3, T4, T5)> { typedef void type; };
124  };
125 
135  template <class> struct result;
136 
141  template <typename F, typename T1, typename T2, typename T3,
142  typename T4, typename T5, typename T6>
143  struct result<F(T1, T2, T3, T4, T5, T6)> { typedef void type; };
144  };
145 
155  template <class> struct result;
156 
161  template <typename F, typename T1, typename T2, typename T3,
162  typename T4, typename T5, typename T6, typename T7>
163  struct result<F(T1, T2, T3, T4, T5, T6, T7)> { typedef void type; };
164  };
165 
166 
168  template <typename L, typename R>
169  void operator()(L& lhs, const R& rhs) const;
170  };
171  extern boost::phoenix::function<assign_lhs> assign_lhs_f;
172 
173 
174  // called from: expression07_grammar
176  void operator()(const expression& expr, bool& pass,
177  std::ostream& error_msgs) const;
178  };
179  extern boost::phoenix::function<validate_expr_type3> validate_expr_type3_f;
180 
181  // called from: term_grammar
183  void operator()(const std::string& s,
184  bool& pass) const;
185  };
186  extern boost::phoenix::function<is_prob_fun> is_prob_fun_f;
187 
188  // called from: expression07_grammar
190  void operator()(expression& expr1, const expression& expr2,
191  std::ostream& error_msgs) const;
192  };
193  extern boost::phoenix::function<addition_expr3> addition3_f;
194 
195  // called from: expression07_grammar
197  void operator()(expression& expr1, const expression& expr2,
198  std::ostream& error_msgs) const;
199  };
200  extern boost::phoenix::function<subtraction_expr3> subtraction3_f;
201 
202  // called from bare_type_grammar
204  void operator()(size_t& lhs) const;
205  };
206  extern boost::phoenix::function<increment_size_t> increment_size_t_f;
207 
208 
209  // called from: expression_grammar
211  void operator()(conditional_op& cond_expr,
212  bool& pass,
213  std::ostream& error_msgs) const;
214  };
215  extern boost::phoenix::function<validate_conditional_op>
217 
218 
219  // called from: expression_grammar
221  void operator()(expression& expr1, const expression& expr2,
222  const std::string& op, const std::string& fun_name,
223  std::ostream& error_msgs) const;
224  };
225  extern boost::phoenix::function<binary_op_expr> binary_op_f;
226 
227  // called from: functions_grammar
229  void operator()(const expr_type& arg_type,
230  bool& pass,
231  std::ostream& error_msgs) const;
232  };
233  extern boost::phoenix::function<validate_non_void_arg_function>
235 
236  // called from: functions_grammar
238  void operator()(const expr_type& return_type, var_origin& origin,
239  bool& pass, std::ostream& error_msgs) const;
240  };
241  extern boost::phoenix::function<set_void_function> set_void_function_f;
242 
243  // called from: functions_grammar
245  void operator()(const std::string& identifier, bool& allow_sampling,
246  int& origin) const;
247  };
248  extern boost::phoenix::function<set_allows_sampling_origin>
250 
251  // called from: functions_grammar
253  void operator()(bool& pass,
254  std::set<std::pair<std::string,
255  function_signature_t> >& declared,
256  std::set<std::pair<std::string,
257  function_signature_t> >& defined,
258  std::ostream& error_msgs) const;
259  };
260  extern boost::phoenix::function<validate_declarations>
262 
263  // called from: functions_grammar
265  void operator()(const function_decl_def& decl,
266  bool& pass,
267  std::set<std::pair<std::string,
268  function_signature_t> >& functions_declared,
269  std::set<std::pair<std::string,
270  function_signature_t> >& functions_defined,
271  std::ostream& error_msgs) const;
272  };
273  extern boost::phoenix::function<add_function_signature>
275 
276  // called from: functions_grammar
278  void operator()(function_decl_def& decl, bool& pass,
279  std::ostream& error_msgs) const;
280  };
281  extern boost::phoenix::function<validate_return_type>
283 
284  // called from: functions_grammar
286  void operator()(function_decl_def& decl, bool& pass,
287  std::ostream& error_msgs) const;
288  };
289  extern boost::phoenix::function<validate_pmf_pdf_variate>
291 
292  // called from: functions_grammar
294  void operator()(std::string& fname, bool& pass,
295  std::ostream& error_msgs) const;
296  };
297  extern boost::phoenix::function<validate_prob_fun> validate_prob_fun_f;
298 
299 
300  // called from: functions_grammar
301  struct scope_lp : public phoenix_functor_unary {
302  void operator()(variable_map& vm) const;
303  };
304  extern boost::phoenix::function<scope_lp> scope_lp_f;
305 
306  // called from: functions_grammar
308  void operator()(function_decl_def& decl,
309  variable_map& vm) const;
310  };
311  extern boost::phoenix::function<unscope_variables> unscope_variables_f;
312 
313  // called from: functions_grammar
315  void operator()(arg_decl& decl, bool& pass, variable_map& vm,
316  std::ostream& error_msgs) const;
317  };
318  extern boost::phoenix::function<add_fun_var> add_fun_var_f;
319 
320  // called from: indexes_grammar
322  void operator()(omni_idx& val) const;
323  };
324  extern boost::phoenix::function<set_omni_idx> set_omni_idx_f;
325 
326  // called from: indexes_grammar, statement_grammar
328  void operator()(const expression & e, bool& pass) const;
329  };
330  extern boost::phoenix::function<validate_int_expression>
332 
333  // called from: indexes_grammar
335  void operator()(const expression & e, bool& pass,
336  std::ostream& error_msgs) const;
337  };
338  extern boost::phoenix::function<validate_ints_expression>
340 
341  // called from: program_grammar
343  void operator()(variable_map& vm) const;
344  };
345  extern boost::phoenix::function<add_lp_var> add_lp_var_f;
346 
347  // called from: program_grammar
349  void operator()(variable_map& vm) const;
350  };
351  extern boost::phoenix::function<remove_lp_var> remove_lp_var_f;
352 
353  // called from: program_grammar
355  void operator()(pos_iterator_t _begin, pos_iterator_t _end,
356  pos_iterator_t _where, variable_map& vm,
357  std::stringstream& error_msgs) const;
358  };
359  extern boost::phoenix::function<program_error> program_error_f;
360 
361  // called from: statement_2_grammar
363  void operator()(conditional_statement& cs, const expression& e,
364  bool& pass, std::stringstream& error_msgs) const;
365  };
366  extern boost::phoenix::function<add_conditional_condition>
368 
369  // called from: statement_2_grammar
371  void operator()(conditional_statement& cs, const statement& s) const;
372  };
373  extern boost::phoenix::function<add_conditional_body>
375 
376  // called from: statement_grammar
378  void operator()(std::ostream& error_msgs) const;
379  };
380  extern boost::phoenix::function<deprecate_old_assignment_op>
382 
383  // called from: statement_grammar
385  void operator()(var_origin origin, bool& pass, std::ostream& error_msgs)
386  const;
387  };
388  extern boost::phoenix::function<validate_return_allowed>
390 
391  // called from: statement_grammar
393  void operator()(var_origin origin, bool& pass, std::ostream& error_msgs)
394  const;
395  };
396  extern boost::phoenix::function<validate_void_return_allowed>
398 
399  // called from: statement_grammar
401  void operator()(const std::string& name, const var_origin& origin_allowed,
402  variable& v, bool& pass, const variable_map& vm,
403  std::ostream& error_msgs) const;
404  };
405  extern boost::phoenix::function<identifier_to_var> identifier_to_var_f;
406 
407  // called from: statement_grammar
409  void operator()(const assgn& a, bool& pass, std::ostream& error_msgs)
410  const;
411  };
412  extern boost::phoenix::function<validate_assgn> validate_assgn_f;
413 
414  // called from: statement_grammar
416  void operator()(assignment& a, const var_origin& origin_allowed,
417  bool& pass, variable_map& vm, std::ostream& error_msgs)
418  const;
419  };
420  extern boost::phoenix::function<validate_assignment> validate_assignment_f;
421 
422  // called from: statement_grammar
424  void operator()(const sample& s, const variable_map& var_map,
425  bool& pass, std::ostream& error_msgs) const;
426  };
427  extern boost::phoenix::function<validate_sample> validate_sample_f;
428 
429  // called from: statement_grammar
431  void operator()(bool& pass, const stan::lang::expression& expr,
432  std::stringstream& error_msgs) const;
433  };
434  extern boost::phoenix::function<expression_as_statement>
436 
437  // called from: statement_grammar
439  void operator()(const std::vector<var_decl>& var_decls, variable_map& vm)
440  const;
441  };
442  extern boost::phoenix::function<unscope_locals> unscope_locals_f;
443 
444  // called from: statement_grammar
446  void operator()(while_statement& ws, const expression& e,
447  bool& pass, std::stringstream& error_msgs) const;
448  };
449  extern boost::phoenix::function<add_while_condition> add_while_condition_f;
450 
451  // called from: statement_grammar
453  void operator()(while_statement& ws, const statement& s) const;
454  };
455  extern boost::phoenix::function<add_while_body> add_while_body_f;
456 
457  // called from: statement_grammar
459  void operator()(const std::string& name, std::string& name_local,
460  bool& pass, variable_map& vm,
461  std::stringstream& error_msgs) const;
462  };
463  extern boost::phoenix::function<add_loop_identifier> add_loop_identifier_f;
464 
465  // called from: statement_grammar
467  void operator()(const std::string& name, variable_map& vm) const;
468  };
469  extern boost::phoenix::function<remove_loop_identifier>
471 
472  // called from: statement_grammar
474  void operator()(const expression& expr, bool& pass,
475  std::stringstream& error_msgs) const;
476  };
477  extern boost::phoenix::function<validate_int_expr_warn>
479 
480  // called from: statement_grammar
482  void operator()(std::stringstream& error_msgs) const;
483  };
484  extern boost::phoenix::function<deprecate_increment_log_prob>
486 
487  // called from: statement_grammar
489  void operator()(const bool& allow_sample, bool& pass,
490  std::stringstream& error_msgs) const;
491  };
492  extern boost::phoenix::function<validate_allow_sample>
494 
495  // called from: statement_grammar
497  void operator()(const expression& e, bool& pass, std::ostream& error_msgs)
498  const;
499  };
500  extern boost::phoenix::function<validate_non_void_expression>
502 
503  // called from: statement_grammar
505  void operator()(statement& stmt,
506  const pos_iterator_t& begin,
507  const pos_iterator_t& end) const;
508  };
509  extern boost::phoenix::function<add_line_number> add_line_number_f;
510 
511  // called from: statement_grammar
513  void operator()(return_statement& s) const;
514  };
515  extern boost::phoenix::function<set_void_return> set_void_return_f;
516 
517  // called from: statement_grammar
519  void operator()(no_op_statement& s) const;
520  };
521  extern boost::phoenix::function<set_no_op> set_no_op_f;
522 
523  // called from: term_grammar
524 
525 
527  void operator()(std::ostream& error_msgs) const;
528  };
529  extern boost::phoenix::function<deprecated_integrate_ode>
531 
532  // test first arguments for both ode calling patterns
533  // (with/without control)
534  template <class T>
535  void validate_integrate_ode_non_control_args(const T& ode_fun,
536  const variable_map& var_map,
537  bool& pass,
538  std::ostream& error_msgs);
539 
540  // called from: term_grammar
542  void operator()(const integrate_ode& ode_fun,
543  const variable_map& var_map, bool& pass,
544  std::ostream& error_msgs) const;
545  };
546  extern boost::phoenix::function<validate_integrate_ode>
548 
549  // called from: term_grammar
551  : public phoenix_functor_quaternary {
552  void operator()(const integrate_ode_control& ode_fun,
553  const variable_map& var_map, bool& pass,
554  std::ostream& error_msgs) const;
555  };
556  extern boost::phoenix::function<validate_integrate_ode_control>
558 
559  // called from: term_grammar
561  void operator()(expression& fun_result, fun& fun,
562  const var_origin& var_origin, bool& pass,
563  std::ostream& error_msgs) const;
564  };
565  extern boost::phoenix::function<set_fun_type_named> set_fun_type_named_f;
566 
567  // called from: term_grammar
569  void operator()(expression& expr1, const expression& expr2,
570  const var_origin& var_origin, bool& pass,
571  std::ostream& error_msgs) const;
572  };
573  extern boost::phoenix::function<exponentiation_expr> exponentiation_f;
574 
575  // called from: term_grammar
577  void operator()(expression& expr1, const expression& expr2,
578  std::ostream& error_msgs) const;
579  };
580  extern boost::phoenix::function<multiplication_expr> multiplication_f;
581 
582  // called from: term_grammar
584  void operator()(expression& expr1, const expression& expr2,
585  std::ostream& error_msgs) const;
586  };
587  extern boost::phoenix::function<division_expr> division_f;
588 
589  // called from: term_grammar
591  void operator()(expression& expr1, const expression& expr2,
592  bool& pass, std::ostream& error_msgs) const;
593  };
594  extern boost::phoenix::function<modulus_expr> modulus_f;
595 
596  // called from: term_grammar
598  void operator()(expression& expr1, bool& pass, const expression& expr2,
599  std::ostream& error_msgs) const;
600  };
601  extern boost::phoenix::function<left_division_expr> left_division_f;
602 
603  // called from: term_grammar
605  void operator()(expression& expr1, const expression& expr2,
606  std::ostream& error_msgs) const;
607  };
608  extern boost::phoenix::function<elt_multiplication_expr>
610 
611  // called from: term_grammar
613  void operator()(expression& expr1, const expression& expr2,
614  std::ostream& error_msgs) const;
615  };
616  extern boost::phoenix::function<elt_division_expr> elt_division_f;
617 
618  // called from: term_grammar
620  void operator()(expression& expr_result, const expression& expr,
621  bool& pass, std::ostream& error_msgs) const;
622  };
623  extern boost::phoenix::function<negate_expr> negate_expr_f;
624 
625  // called from: term_grammar
627  void operator()(expression& expr_result, const expression& expr,
628  std::ostream& error_msgs) const;
629  };
630  extern boost::phoenix::function<logical_negate_expr> logical_negate_expr_f;
631 
632  // called from: term_grammar
634  void operator()(expression& expr, bool& pass,
635  std::ostream& error_msgs) const;
636  };
637  extern boost::phoenix::function<transpose_expr> transpose_f;
638 
639  // called from: term_grammar
641  void operator()(expression& e, std::vector<idx>& idxs, bool& pass,
642  std::ostream& error_msgs) const;
643  };
644  extern boost::phoenix::function<add_idxs> add_idxs_f;
645 
646  // called from: term_grammar
649  std::vector<std::vector<stan::lang::expression> >& dimss,
650  bool& pass, std::ostream& error_msgs) const;
651  };
652  extern boost::phoenix::function<add_expression_dimss>
654 
655  // called from: term_grammar
657  void operator()(variable& var_expr, expression& val, variable_map& vm,
658  std::ostream& error_msgs, bool& pass) const;
659  };
660  extern boost::phoenix::function<set_var_type> set_var_type_f;
661 
662  struct validate_no_constraints_vis : public boost::static_visitor<bool> {
663  std::stringstream& error_msgs_;
664  explicit validate_no_constraints_vis(std::stringstream& error_msgs);
665  bool operator()(const nil& /*x*/) const;
666  bool operator()(const int_var_decl& x) const;
667  bool operator()(const double_var_decl& x) const;
668  bool operator()(const vector_var_decl& x) const;
669  bool operator()(const row_vector_var_decl& x) const;
670  bool operator()(const matrix_var_decl& x) const;
671  bool operator()(const unit_vector_var_decl& /*x*/) const;
672  bool operator()(const simplex_var_decl& /*x*/) const;
673  bool operator()(const ordered_var_decl& /*x*/) const;
674  bool operator()(const positive_ordered_var_decl& /*x*/) const;
675  bool operator()(const cholesky_factor_var_decl& /*x*/) const;
676  bool operator()(const cholesky_corr_var_decl& /*x*/) const;
677  bool operator()(const cov_matrix_var_decl& /*x*/) const;
678  bool operator()(const corr_matrix_var_decl& /*x*/) const;
679  };
680 
681  struct data_only_expression : public boost::static_visitor<bool> {
682  std::stringstream& error_msgs_;
684  data_only_expression(std::stringstream& error_msgs,
685  variable_map& var_map);
686  bool operator()(const nil& /*e*/) const;
687  bool operator()(const int_literal& /*x*/) const;
688  bool operator()(const double_literal& /*x*/) const;
689  bool operator()(const array_literal& x) const;
690  bool operator()(const variable& x) const;
691  bool operator()(const integrate_ode& x) const;
692  bool operator()(const integrate_ode_control& x) const;
693  bool operator()(const fun& x) const;
694  bool operator()(const index_op& x) const;
695  bool operator()(const index_op_sliced& x) const;
696  bool operator()(const conditional_op& x) const;
697  bool operator()(const binary_op& x) const;
698  bool operator()(const unary_op& x) const;
699  };
700 
701  // called from: var_decls_grammar
703  void operator()(const bool& allow_constraints,
704  const bool& declaration_ok, const var_decl& var_decl,
705  bool& pass, std::stringstream& error_msgs) const;
706  };
707  extern boost::phoenix::function<validate_decl_constraints>
709 
710 
712  std::set<std::string> reserved_word_set_;
713  std::set<std::string> const_fun_name_set_;
715  void operator()(const std::string& identifier, bool& pass,
716  std::stringstream& error_msgs) const;
717  bool contains(const std::set<std::string>& s,
718  const std::string& x) const;
719  bool identifier_exists(const std::string& identifier) const;
720  void reserve(const std::string& w);
721  };
722  extern boost::phoenix::function<validate_identifier> validate_identifier_f;
723 
724  // copies single dimension from M to N if only M declared
726  : public phoenix_functor_unary {
728  };
729  extern boost::phoenix::function<copy_square_cholesky_dimension_if_necessary>
731 
733  void operator()(range& r, std::stringstream& /*error_msgs*/) const;
734  };
735  extern boost::phoenix::function<empty_range> empty_range_f;
736 
738  void operator()(const expression& expr, bool& pass,
739  std::stringstream& error_msgs) const;
740  };
741  extern boost::phoenix::function<validate_int_expr> validate_int_expr_f;
742 
744  void operator()(range& range, const expression& expr, bool& pass,
745  std::stringstream& error_msgs) const;
746  };
747  extern boost::phoenix::function<set_int_range_lower> set_int_range_lower_f;
748 
750  void operator()(range& range, const expression& expr, bool& pass,
751  std::stringstream& error_msgs) const;
752  };
753  extern boost::phoenix::function<set_int_range_upper> set_int_range_upper_f;
754 
756  void operator()(const expression& expr, int var_origin, bool& pass,
757  variable_map& var_map, std::stringstream& error_msgs)
758  const;
759  };
760  extern boost::phoenix::function<validate_int_data_expr>
762 
764  void operator()(range& range, const expression& expr, bool& pass,
765  std::stringstream& error_msgs) const;
766  };
767  extern boost::phoenix::function<set_double_range_lower>
769 
771  void operator()(range& range, const expression& expr, bool& pass,
772  std::stringstream& error_msgs) const;
773  };
774  extern boost::phoenix::function<set_double_range_upper>
776 
777  struct add_var : public phoenix_functor_senary {
778  template <typename T>
779  void operator()(var_decl& var_decl_result, const T& var_decl,
780  variable_map& vm, bool& pass, const var_origin& vo,
781  std::ostream& error_msgs)
782  const;
783  };
784  extern boost::phoenix::function<add_var> add_var_f;
785 
786  }
787 }
788 #endif
boost::phoenix::function< validate_return_allowed > validate_return_allowed_f
void operator()(const std::string &identifier, bool &allow_sampling, int &origin) const
void operator()(expression &expr_result, const expression &expr, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< set_void_function > set_void_function_f
void operator()(expression &expr1, const expression &expr2, std::ostream &error_msgs) const
boost::phoenix::function< add_while_body > add_while_body_f
void operator()(const std::string &identifier, bool &pass, std::stringstream &error_msgs) const
void operator()(const expr_type &arg_type, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< set_int_range_upper > set_int_range_upper_f
void operator()(const bool &allow_sample, bool &pass, std::stringstream &error_msgs) const
void operator()(const integrate_ode &ode_fun, const variable_map &var_map, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< validate_assgn > validate_assgn_f
boost::phoenix::function< set_var_type > set_var_type_f
void set_fun_type(fun &fun, std::ostream &error_msgs)
void operator()(expression &e, std::vector< idx > &idxs, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< set_int_range_lower > set_int_range_lower_f
void operator()(const expression &expr, bool &pass, std::stringstream &error_msgs) const
boost::phoenix::function< binary_op_expr > binary_op_f
boost::phoenix::function< validate_expr_type3 > validate_expr_type3_f
void operator()(std::stringstream &error_msgs) const
boost::phoenix::function< deprecated_integrate_ode > deprecated_integrate_ode_f
int num_dimss(std::vector< std::vector< stan::lang::expression > > &dimss)
void operator()(const expression &e, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< set_fun_type_named > set_fun_type_named_f
std::set< std::string > const_fun_name_set_
Declare result to be a template struct.
boost::phoenix::function< set_no_op > set_no_op_f
void operator()(const expression &e, bool &pass) const
boost::phoenix::function< validate_conditional_op > validate_conditional_op_f
void operator()(function_decl_def &decl, bool &pass, std::ostream &error_msgs) const
Probability, optimization and sampling library.
void operator()(range &range, const expression &expr, bool &pass, std::stringstream &error_msgs) const
Declare result to be a template struct.
boost::phoenix::function< deprecate_increment_log_prob > deprecate_increment_log_prob_f
void operator()(expression &expr1, const expression &expr2, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< program_error > program_error_f
void operator()(expression &expr1, const expression &expr2, std::ostream &error_msgs) const
validate_no_constraints_vis(std::stringstream &error_msgs)
void operator()(var_decl &var_decl_result, const T &var_decl, variable_map &vm, bool &pass, const var_origin &vo, std::ostream &error_msgs) const
void operator()(const std::vector< var_decl > &var_decls, variable_map &vm) const
void operator()(const expression &e, bool &pass, std::ostream &error_msgs) const
bool validate_double_expr(const expression &expr, std::stringstream &error_msgs)
boost::phoenix::function< validate_int_expression > validate_int_expression_f
bool has_prob_suffix(const std::string &s)
void operator()(std::ostream &error_msgs) const
void operator()(range &range, const expression &expr, bool &pass, std::stringstream &error_msgs) const
void operator()(while_statement &ws, const expression &e, bool &pass, std::stringstream &error_msgs) const
boost::spirit::line_pos_iterator< input_iterator_t > pos_iterator_t
void operator()(expression &expr_result, const expression &expr, std::ostream &error_msgs) const
void operator()(cholesky_factor_var_decl &var_decl) const
void operator()(expression &expr1, bool &pass, const expression &expr2, std::ostream &error_msgs) const
boost::phoenix::function< validate_ints_expression > validate_ints_expression_f
boost::phoenix::function< add_conditional_condition > add_conditional_condition_f
boost::phoenix::function< empty_range > empty_range_f
boost::phoenix::function< subtraction_expr3 > subtraction3_f
boost::phoenix::function< addition_expr3 > addition3_f
This is the base class for septenary functors that are adapted to lazy semantic actions by boost::pho...
void operator()(const expression &expr, int var_origin, bool &pass, variable_map &var_map, std::stringstream &error_msgs) const
void operator()(std::string &fname, bool &pass, std::ostream &error_msgs) const
This is the base class for quatenary functors that are adapted to lazy semantic actions by boost::pho...
void validate_integrate_ode_non_control_args(const T &ode_fun, const variable_map &var_map, bool &pass, std::ostream &error_msgs)
void replace_suffix(const std::string &old_suffix, const std::string &new_suffix, fun &f)
Declare result to be a template struct.
boost::phoenix::function< add_var > add_var_f
boost::phoenix::function< remove_lp_var > remove_lp_var_f
void operator()(const integrate_ode_control &ode_fun, const variable_map &var_map, bool &pass, std::ostream &error_msgs) const
void operator()(arg_decl &decl, bool &pass, variable_map &vm, std::ostream &error_msgs) const
boost::phoenix::function< exponentiation_expr > exponentiation_f
boost::phoenix::function< add_loop_identifier > add_loop_identifier_f
Declare result to be a template struct.
boost::phoenix::function< set_double_range_lower > set_double_range_lower_f
boost::phoenix::function< validate_void_return_allowed > validate_void_return_allowed_f
void operator()(omni_idx &val) const
void operator()(expression &expr1, const expression &expr2, const std::string &op, const std::string &fun_name, std::ostream &error_msgs) const
void operator()(conditional_op &cond_expr, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< validate_non_void_arg_function > validate_non_void_arg_f
bool contains(const std::set< std::string > &s, const std::string &x) const
void operator()(statement &stmt, const pos_iterator_t &begin, const pos_iterator_t &end) const
void reserve(const std::string &w)
boost::phoenix::function< remove_loop_identifier > remove_loop_identifier_f
void operator()(expression &expr1, const expression &expr2, std::ostream &error_msgs) const
void operator()(range &range, const expression &expr, bool &pass, std::stringstream &error_msgs) const
boost::phoenix::function< add_conditional_body > add_conditional_body_f
boost::phoenix::function< transpose_expr > transpose_f
boost::phoenix::function< multiplication_expr > multiplication_f
void operator()(const std::string &s, bool &pass) const
void operator()(const bool &allow_constraints, const bool &declaration_ok, const var_decl &var_decl, bool &pass, std::stringstream &error_msgs) const
boost::phoenix::function< validate_identifier > validate_identifier_f
void operator()(expression &expression, std::vector< std::vector< stan::lang::expression > > &dimss, bool &pass, std::ostream &error_msgs) const
This is the base class for binary functors that are adapted to lazy semantic actions by boost::phoeni...
boost::phoenix::function< validate_int_expr > validate_int_expr_f
void operator()(range &range, const expression &expr, bool &pass, std::stringstream &error_msgs) const
void operator()(expression &fun_result, fun &fun, const var_origin &var_origin, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< validate_decl_constraints > validate_decl_constraints_f
boost::phoenix::function< add_expression_dimss > add_expression_dimss_f
void operator()(expression &expr1, const expression &expr2, std::ostream &error_msgs) const
This is the base class for quinary functors that are adapted to lazy semantic actions by boost::phoen...
boost::phoenix::function< validate_prob_fun > validate_prob_fun_f
boost::phoenix::function< add_line_number > add_line_number_f
boost::phoenix::function< validate_int_data_expr > validate_int_data_expr_f
void operator()(const assgn &a, bool &pass, std::ostream &error_msgs) const
void operator()(variable &var_expr, expression &val, variable_map &vm, std::ostream &error_msgs, bool &pass) const
void operator()(const expression &expr, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< is_prob_fun > is_prob_fun_f
void operator()(conditional_statement &cs, const expression &e, bool &pass, std::stringstream &error_msgs) const
int var_origin
Definition: ast.hpp:76
boost::phoenix::function< set_omni_idx > set_omni_idx_f
void operator()(var_origin origin, bool &pass, std::ostream &error_msgs) const
void operator()(const std::string &name, std::string &name_local, bool &pass, variable_map &vm, std::stringstream &error_msgs) const
std::pair< expr_type, std::vector< expr_type > > function_signature_t
Definition: ast.hpp:127
boost::phoenix::function< validate_allow_sample > validate_allow_sample_f
boost::phoenix::function< assign_lhs > assign_lhs_f
This is the base class for senary functors that are adapted to lazy semantic actions by boost::phoeni...
std::set< std::string > reserved_word_set_
void operator()(size_t &lhs) const
void operator()(std::ostream &error_msgs) const
boost::phoenix::function< validate_integrate_ode > validate_integrate_ode_f
This is the base class for unnary functors that are adapted to lazy semantic actions by boost::phoeni...
boost::phoenix::function< expression_as_statement > expression_as_statement_f
boost::phoenix::function< validate_pmf_pdf_variate > validate_pmf_pdf_variate_f
boost::phoenix::function< add_lp_var > add_lp_var_f
void operator()(const std::string &name, variable_map &vm) const
boost::phoenix::function< elt_multiplication_expr > elt_multiplication_f
void operator()(const expr_type &return_type, var_origin &origin, bool &pass, std::ostream &error_msgs) const
void operator()(variable_map &vm) const
void operator()(function_decl_def &decl, variable_map &vm) const
void operator()(expression &expr1, const expression &expr2, const var_origin &var_origin, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< set_allows_sampling_origin > set_allows_sampling_origin_f
void operator()(expression &expr, bool &pass, std::ostream &error_msgs) const
void operator()(expression &expr1, const expression &expr2, std::ostream &error_msgs) const
boost::phoenix::function< validate_int_expr_warn > validate_int_expr_warn_f
boost::phoenix::function< logical_negate_expr > logical_negate_expr_f
bool identifier_exists(const std::string &identifier) const
This is the base class for ternary functors that are adapted to lazy semantic actions by boost::phoen...
boost::phoenix::function< validate_sample > validate_sample_f
boost::phoenix::function< increment_size_t > increment_size_t_f
boost::phoenix::function< add_function_signature > add_function_signature_f
void operator()(const expression &expr, bool &pass, std::stringstream &error_msgs) const
void operator()(const function_decl_def &decl, bool &pass, std::set< std::pair< std::string, function_signature_t > > &functions_declared, std::set< std::pair< std::string, function_signature_t > > &functions_defined, std::ostream &error_msgs) const
boost::phoenix::function< set_double_range_upper > set_double_range_upper_f
boost::phoenix::function< add_idxs > add_idxs_f
void operator()(function_decl_def &decl, bool &pass, std::ostream &error_msgs) const
void operator()(while_statement &ws, const statement &s) const
void operator()(const std::string &name, const var_origin &origin_allowed, variable &v, bool &pass, const variable_map &vm, std::ostream &error_msgs) const
boost::phoenix::function< unscope_locals > unscope_locals_f
void operator()(bool &pass, std::set< std::pair< std::string, function_signature_t > > &declared, std::set< std::pair< std::string, function_signature_t > > &defined, std::ostream &error_msgs) const
Declare result to be a template struct.
boost::phoenix::function< division_expr > division_f
boost::phoenix::function< unscope_variables > unscope_variables_f
void operator()(const sample &s, const variable_map &var_map, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< elt_division_expr > elt_division_f
Declare result to be a template struct.
boost::phoenix::function< identifier_to_var > identifier_to_var_f
void operator()(range &r, std::stringstream &) const
boost::phoenix::function< negate_expr > negate_expr_f
void operator()(variable_map &vm) const
void operator()(L &lhs, const R &rhs) const
boost::phoenix::function< copy_square_cholesky_dimension_if_necessary > copy_square_cholesky_dimension_if_necessary_f
boost::phoenix::function< validate_return_type > validate_return_type_f
boost::phoenix::function< add_fun_var > add_fun_var_f
void operator()(expression &expr1, const expression &expr2, std::ostream &error_msgs) const
boost::phoenix::function< add_while_condition > add_while_condition_f
boost::phoenix::function< validate_assignment > validate_assignment_f
boost::phoenix::function< validate_integrate_ode_control > validate_integrate_ode_control_f
Placeholder struct for boost::variant default ctors.
Definition: ast.hpp:18
boost::phoenix::function< validate_declarations > validate_declarations_f
void operator()(no_op_statement &s) const
boost::phoenix::function< left_division_expr > left_division_f
boost::phoenix::function< set_void_return > set_void_return_f
boost::phoenix::function< modulus_expr > modulus_f
data_only_expression(std::stringstream &error_msgs, variable_map &var_map)
boost::phoenix::function< scope_lp > scope_lp_f
void operator()(conditional_statement &cs, const statement &s) const
void operator()(return_statement &s) const
boost::phoenix::function< deprecate_old_assignment_op > deprecate_old_assignment_op_f
Declare result to be a template struct.
void operator()(assignment &a, const var_origin &origin_allowed, bool &pass, variable_map &vm, std::ostream &error_msgs) const
void operator()(var_origin origin, bool &pass, std::ostream &error_msgs) const
boost::phoenix::function< validate_non_void_expression > validate_non_void_expression_f
void operator()(variable_map &vm) const
void operator()(bool &pass, const stan::lang::expression &expr, std::stringstream &error_msgs) const
void operator()(pos_iterator_t _begin, pos_iterator_t _end, pos_iterator_t _where, variable_map &vm, std::stringstream &error_msgs) const

     [ Stan Home Page ] © 2011–2016, Stan Development Team.