寻找组合覆盖。
CombCov的Python项目详细描述
梳cov
置换特定算法Struct的推广-- 扩展到其他类型的组合对象。
演示
看看这个repo中的demo/
文件夹,看看如何使用
CombCov
与您自己的组合对象。在示例中,找到一个string集
覆盖字母表{a,b}
上的字符串集,以避免子字符串
aa
(意味着集合中没有包含作为子字符串的aa
)。
$ python -m demo.string_set [INFO](CombCov) Enumerating all elements of size up to 7... [INFO](CombCov) ...DONE enumerating elements! (Running time: 0.00 sec)[INFO](CombCov) Total of 87 elements. [INFO](CombCov) Enumeration: [1, 2, 3, 5, 8, 13, 21, 34][INFO](CombCov) Creating binary strings from rules... [INFO](CombCov) Bitstring to cover: 154742504910672534362390527[INFO](StringSet) Generated 16 subrules [INFO](CombCov) ...DONE creating binary strings! (Running time: 0.00 sec)[INFO](CombCov) Total of 14 valid rules with 14 distinct binary strings. [INFO](CombCov) Searching for a cover for''*Av(aa) over ∑={a,b}... [INFO](CombCov) Gurobi installed on system and set as solver [INFO](CombCov) ...DONE searching for a cover! (Running time: 0.02 sec) Solution found! - Rule #1: ''*Av(a,b) over ∑={a,b} with bitstring 1 - Rule #2: 'a'*Av(a,b) over ∑={a,b} with bitstring 2 - Rule #3: 'b'*Av(aa) over ∑={a,b} with bitstring 154742431132702343545997108 - Rule #4: 'ab'*Av(aa) over ∑={a,b} with bitstring 73777970190816393416
开发
运行unittests(同时覆盖demo
模块):
./setup.py test --addopts --cov=demo