<commit_before>/**
 * @file
 */
#include "bi/exception/AssumeException.hpp"

#include "bi/io/bih_ostream.hpp"

bi::AssumeException::AssumeException(const Assume* o) {
  std::stringstream base;
  bih_ostream buf(base);
  if (o->loc) {
    buf << o->loc;
  }
  buf << "error: incompatible types in assume\n";
  if (o->loc) {
    buf << o->loc;
  }
  buf << "note: in\n";
  buf << o;

  if (o->left->loc) {
    buf << o->left->loc;
  }
  buf << "note: left type is\n";
  buf << o->left->type << '\n';

  if (o->right->loc) {
    buf << o->right->loc;
  }
  buf << "note: right type is\n";
  buf << o->right->type << '\n';
  buf << "note: types should be Random<Value> ~ Distribution<Value> for some common Value.\n";
  msg = base.str();
}
<commit_msg>Updated error message for AssumeException, as out of date.<commit_after>/**
 * @file
 */
#include "bi/exception/AssumeException.hpp"

#include "bi/io/bih_ostream.hpp"

bi::AssumeException::AssumeException(const Assume* o) {
  std::stringstream base;
  bih_ostream buf(base);
  if (o->loc) {
    buf << o->loc;
  }
  buf << "error: incompatible types for probabilistic operator\n";
  if (o->loc) {
    buf << o->loc;
  }
  buf << "note: in\n";
  buf << o;

  if (o->left->loc) {
    buf << o->left->loc;
  }
  buf << "note: left type is\n";
  buf << o->left->type << '\n';

  if (o->right->loc) {
    buf << o->right->loc;
  }
  buf << "note: right type is\n";
  buf << o->right->type << '\n';
  buf << "note: types should be Value or Random<Value> on left, Distribution<Value> on right, for some common Value type.\n";
  msg = base.str();
}

{'fraction_non_alphanumeric': 0.20578980490874765, 'fraction_numerical': 0.0, 'mean_word_length': 3.005037783375315, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3808101', 'n_tokens_mistral': 606, 'n_tokens_neox': 591, 'n_words': 154}