Skip to content
Snippets Groups Projects
  1. Jan 26, 2022
  2. Jan 02, 2022
  3. Dec 26, 2021
  4. Dec 20, 2021
  5. Dec 05, 2021
    • Tomáš Pecka's avatar
      algo: Fix AutomataConcatenation when first automaton has a word of len 1 · 0fb7a684
      Tomáš Pecka authored
      The algorithm, taken from BI-AAG course @ FIT CTU did not work
      correctly when first automaton accepts a word of length 1.
      
      There are two bugs. First, the set of final states was wrong. This was
      the easy part to spot.
      Second, we sometimes miss some transitions.
      
      Consider these two automata:
       DFA a b
       ><A B -
        <B - -
      
       DFA a b
       ><C - -
      
      The algorithm would result in this:
       DFA a   b
       ><S B   C
         A B|C -
         B -   -
        <C -   C
      
      Which is of course wrong because the first automaton accepts "a + #E"
      and the second one accepts a language of "b*". However, the result
      doesn't accept words from neither "a" nor "ab*" which is in language
      "(a+#E)b*".
      
      The problem is that for every transition in the first automaton that
      leads to a final state we create a new transition to an initial state of
      the second automaton. This effectively says that "ok, we are done with
      first automaton, we would accept. Let's continue from the initial state
      of the second automaton".
      Also, when we create a new initial state, we *only* copy transitions from
      both initial states there. But if the word is of length 1 and is to be
      accepted by the first automaton, we are missing this "transition to second
      automaton".
      In our example above, we need to add a transition (S, a) -> C and it's
      fine.
      0fb7a684
  6. Dec 03, 2021
  7. Nov 27, 2021
  8. Nov 26, 2021
  9. Nov 23, 2021
  10. Nov 21, 2021
    • Jan Trávníček's avatar
      algo: fix MP algo · e2929988
      Jan Trávníček authored and Tomáš Pecka's avatar Tomáš Pecka committed
      MP algorithm was always resetting the pattern index to 0 whereas it should be
      reused. This revealed that Spos should also take into account node wildcards
      otherwise the presumed not-necessary-to-be-parsed part of the pattern does not
      have to be matching the pattern. Which caused the computation of what does not
      need to be matched to underflow.
      e2929988
  11. Nov 20, 2021
  12. Oct 15, 2021
  13. Jul 20, 2021
  14. May 28, 2021
  15. Apr 03, 2021
  16. Mar 25, 2021
  17. Mar 11, 2021
    • Tomáš Pecka's avatar
      tests: Fix wrong select timeout handling since glibc=2.33 · 172f6acd
      Tomáš Pecka authored
      In recent Arch Linux builds we encountered some timeouts in tests.
      Interestingly, the 30s timeouts were encountered not after 30s but
      right-away. See the ctest output attached at the end of the message.
      
      I remembered that Arch switched to glibc=2.33 recently. And by stracing
      the test process I have noticed that indeed, the select in waitSignalTimeout
      function timeouted early.
      It seemed that the timeval struct is the problem and indeed it was. It
      didn't like setting the 30s timeout as {.tv_sec = 0, .tv_usec = 30 *
      1000 * 1000}. However, I can't find in any manpage why this is wrong...
      
      It seems to be fixed by limiting tv_usec to be from [0; 1000*1000)
      range and transfer the whole seconds into the tv_sec field.
      And the glibc docs [1] says it so explicitely:
      
      > When struct timeval values are produced by GNU C Library functions,
      > the value in this field will always be greater than or equal to zero,
      > and less than 1,000,000. When struct timeval values are supplied to GNU
      > C Library functions, the value in this field must be in the same range.
      
      [1] https://www.gnu.org/software/libc/manual/html_mono/libc.html#Time-Types
      
       -------------------------------------------------------------------------------
       aql/AutomatonIteration.aql
       -------------------------------------------------------------------------------
       /builds/algorithms-library-toolkit/infrastructure/cd-release/src/algorithms-library-snapshot/build/tests/AutomatonIteration.cpp:17
       ...............................................................................
      
       /builds/algorithms-library-toolkit/infrastructure/cd-release/src/algorithms-library-snapshot/tests/testing/TimeoutAqlTest.cpp:206: warning:
         AqlTest: timeout (30000000 us) reached
         Trying to execute testfile /builds/algorithms-library-toolkit/infrastructure/cd-release/src/algorithms-library-snapshot/tests/aql/AutomatonIteration.aql
      
       Seed was: 1053288110
         Child aqlout was: ><
         Child stdout was: ><
         Child stderr was: ><
      
       /builds/algorithms-library-toolkit/infrastructure/cd-release/src/algorithms-library-snapshot/tests/testing/TimeoutAqlTest.cpp:208: FAILED:
      
       ===============================================================================
       test cases: 1 | 1 failed
       assertions: 3 | 2 passed | 1 failed
      172f6acd
  18. Mar 08, 2021
  19. Jan 31, 2021
    • Tomáš Pecka's avatar
      algo: Add integration aql test for FA iteration algorithms · 6ff8fe45
      Tomáš Pecka authored
      This test generates a random automaton, runs both iteration algorithms on
      it and then tests that both these automata accept equal language.
      
      This is first of the aql integration tests (which support was added in
      commit d79fe028). This should serve as
      an example how to write aql integration tests.
      Also, this is something that should not be in the unit tests (and it
      was removed in the previous commits).
      6ff8fe45
  20. Jan 30, 2021
  21. Jan 15, 2021
  22. Oct 08, 2020
  23. Aug 06, 2020
  24. Aug 04, 2020
  25. Aug 03, 2020
Loading