Add array-of-u32 Huffman decoder.

This commit is contained in:
Nigel Tao committed 2017-07-27 11:30:43 +10:00
1 parent d4ab9caa33
commit eee67e083d
5 files changed
+245 -7

No files matched your search

+20
View File
@@ -72,6 +72,26 @@ var reasons = [...]struct {
return nil
}},
{`"a <= b: a <= c; c <= b"`, func(q *checker, n *a.Assert) error {
op, xa, xb := parseBinaryOp(n.Condition())
if op.Key() != t.KeyXBinaryLessEq {
return errFailed
}
// a <= c
xc := argValue(q.tm, n.Args(), "c")
if xc == nil {
return errFailed
}
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xa, xc); err != nil {
return err
}
// c <= b
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xc, xb); err != nil {
return err
}
return nil
}},
{`"a < (b + c): a < (b0 + c0); b0 <= b; c0 <= c"`, func(q *checker, n *a.Assert) error {
op, xa, t0 := parseBinaryOp(n.Condition())
if op.Key() != t.KeyXBinaryLessThan {