1. Jul 11, 2019
    • Matthew Fernandez's avatar
      fix: suppress encoding errors during testing · 14de19ce
      Matthew Fernandez authored
      In CI the test script thinks the system locale is ASCII, but apparently one of
      the subprocesses gives us non-ASCII data. Rather than trying to deal with this
      mess, just ignore encoding errors when piping data back to stdout/stderr.
      14de19ce
  2. Jul 10, 2019
  3. Jul 09, 2019
    • Matthew Fernandez's avatar
      Merge branch 'bugfix/github-142' · ea0e78d1
      Matthew Fernandez authored
      ea0e78d1
    • Matthew Fernandez's avatar
      add some extra assume statement tests · 0cf8e57a
      Matthew Fernandez authored
      0cf8e57a
    • Matthew Fernandez's avatar
      enable now-passing test · 37be26cf
      Matthew Fernandez authored
      Github: related to #142 "pending-queue.m terminates exploration too early"
      37be26cf
    • Matthew Fernandez's avatar
      fix: perform quantifier loop comparison as signed · 2329056d
      Matthew Fernandez authored
      This was leading to the misc/pending-queue.m model terminating early with a
      surprisingly small number of states. Some more explanation from the Github
      issue:
      
        The misc/pending-queue.m model produces many fewer states (81) than it used to
        (147487952), which is unexpected. Bisecting indicates 79579fd5 is the first bad
        commit.
        ...
        The problem here is that commit 79579fd5 inadvertently caused the comparison in
        the loop emitted for a quantifier to become unsigned. A quantifier emits code
        that previously looked something like:
      
          const value_t step = VALUE_C(1);
          const value_t lb = VALUE_C(-1);
          const value_t ub = VALUE_C(3);
          for (value_t _ru1_i = lb; _ru_i <= ub; _ru_i += step) {
          ...
      
        After that commit, the emitted code looks like:
      
          const raw_value_t step = (raw_value_t)1;
          const raw_value_t lb = (raw_value_t)VALUE_C(-1);
          const raw_value_t ub = (raw_value_t)VALUE_C(3);
          for (raw_value_t _ru1_i = 1; _ru_i <= ub - lb + 1; _ru_i += step) {
          ...
      
        Now everything generally works out fine except in cases like the above when
        the range spans positive and negative values. Notice that the first iteration
        of the loop in the second case already has a false condition. The problem here
        is that the comparison was previously comparing value_ts and now it's
        comparing raw_value_ts. In a typical model this goes from comparing int8_t
        values to uint8_t values.
      
      Github: closes #142 "pending-queue.m terminates exploration too early"
      2329056d
    • Matthew Fernandez's avatar
      add a test for the signed/unsigned comparison problem · f3c1b183
      Matthew Fernandez authored
      Github: related to #142 "pending-queue.m terminates exploration too early"
      f3c1b183
  4. Jul 08, 2019
  5. Jul 07, 2019
  6. Jul 06, 2019
  7. Jul 05, 2019
    • Matthew Fernandez's avatar
      deprecate VarDecl::state_variable · 6a4f9ac3
      Matthew Fernandez authored
      We can't explicitly mark this deprecated because it triggers compiler warnings
      when calling the implicit copy constructor from within Ptr's copy constructor.
      6a4f9ac3
    • Matthew Fernandez's avatar
      use VarDecl::offset for is_in_state() · 175193b6
      Matthew Fernandez authored
      This means ExprID::referent->is_in_state() is now usable as the offset
      information within referents is consistent in a way
      ExprID::referent->state_variable is not.
      175193b6
    • Matthew Fernandez's avatar
      introduce VarDecl::is_in_state as a replacement for VarDecl::state_variable · 39bf6a26
      Matthew Fernandez authored
      The latter was probably introduced too hastily and doesn't make for a good API.
      We would like to have the freedom to change how we decide whether something is
      in the state.
      39bf6a26
    • Matthew Fernandez's avatar
      move reindexing prior to symbol resolution and model validation · c3d23559
      Matthew Fernandez authored
      The purpose of this is to ensure that resolved symbols (e.g. ExprID::referent)
      have the same final index as their original target declaration.
      c3d23559
    • Matthew Fernandez's avatar
      move state offset calculation into symbol resolution instead of reindexing · 7268f636
      Matthew Fernandez authored
      The offset calculation did not have much to do with reindexing and I think it
      may have just been put here because it was a convenient post-resolution place
      for it. An unfortunate side effect of this design was that resolved referents
      had an invalid offset. To see why this is, note that symbol resolution (1)
      replaces null referents with a *copy* of the target node and (2) runs prior to
      reindexing. That is, the offset calculation in reindexing would only affect the
      original state VarDecl, not its copies in ExprID referents.
      
      None of what has just been described was a bug. The offsets of the VarDecl
      copies are never used. But its presence incorrectly suggests to librumur clients
      that it is usable.
      
      In this commit we move the offset calculation to its more natural place within
      symbol resolution. We do offset calculation *prior* to declaring a VarDecl in
      the symbol table. This results in ExprIDs now receiving a referent with correct
      offset information. Note that we need to do some extra checks because a
      just-parsed VarDecl is part of an unvalidated model and may be invalid.
      
      All this is part of a broader direction to make all the fields of a referent
      valid and usable.
      7268f636
    • Matthew Fernandez's avatar
      deprecate validate_model · 45f095c9
      Matthew Fernandez authored
      This will be removed in a future release.
      45f095c9
    • Matthew Fernandez's avatar
    • Matthew Fernandez's avatar
      introduce a function for recursively validating any AST node · 499857ec
      Matthew Fernandez authored
      This is the equivalent of validate_model, but for *any* node in the AST.
      499857ec
    • Matthew Fernandez's avatar
      descend into referents during validation · 860f71d1
      Matthew Fernandez authored
      We're about to introduce a function for validating any subpart of the AST. That
      is, effectively calling validate_model with a node other than the topmost node.
      This means that the referent of a reference node (ExprID, FunctionCall or
      TypeExprID) may not yet have been validated. So we need to drop the optimization
      that avoids descending into these.
      
      This makes validating a model take longer, but the difference should be
      negligible. If this becomes a problem, we could start memoising visitor
      dispatch.
      860f71d1
  8. Jul 04, 2019