acc: implement min_set() and max_set() using gcc builtins

Fixes #238.

* spot/twa/acc.hh (max_set): Add a version using __builtin_clz().
(min_set): New method.
* tests/core/acc.cc, tests/core/acc.test: Add some tests.
This commit is contained in:
Alexandre Duret-Lutz 2017-03-02 14:17:06 +01:00
parent 22a3d1c393
commit 1eb5be543d
3 changed files with 42 additions and 7 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
# Copyright (C) 2014, 2015, 2017 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
@ -25,6 +25,8 @@ set -e
cat >expect <<EOF
Inf(0)&Inf(1)&Inf(2)&Inf(3)
0 0
3 2
#2: {0,2}
#2: {0,3}
#2: {1,2}
@ -41,6 +43,7 @@ Inf(0)&Inf(1)&Inf(2)&Inf(3)
#5: {0,1,2,3,4} accepting
#2: {1,2}
5 + 5 = 10
8 1
#4: {0,3,6,7}
#7: {0,1,2,3,4,6,7}
#10: {0,1,2,3,4,5,6,7,8,9} accepting