Commit Graph

13 Commits

Author SHA1 Message Date
Brian Huffman
7ea4884fdd Remove unused primitive type operator lengthFromThen. 2019-02-27 17:11:18 -08:00
Iavor Diatchki
5bad18d3d7 Fix broken library: constants must start with an identifier! :) 2019-01-09 11:31:25 -08:00
Iavor Diatchki
f0e9dcf471 Just a different example.
This used to work with Z3 4.7.1 but does not with 4.8.4
2019-01-09 11:26:53 -08:00
Iavor Diatchki
454dd58fbd Name some of the big numbers. 2019-01-09 11:26:14 -08:00
Iavor Diatchki
ad766b3aa7 Reformulate the property, so that Z3 can still find models.
With the other formulation, Z3  became really bad at finding any kind
of model.  Basically, it would always answer `unsat` or `unknown`.

This is undesirable, because we use models when instantiating things
at the command line.  In those cases, however, we probably don't
need the rule at all...  Perhaps, we should provide a way to disable
the axioms when we are looking for models?
2018-09-15 11:04:37 +03:00
Iavor Diatchki
a8d5963bfa Add another property of width.
Fixes #548
2018-09-14 22:50:30 +03:00
Iavor Diatchki
4e843a3435 More consistent statement of axioms for cryWidthUnknown 2018-09-14 10:21:08 +03:00
Brian Huffman
95cedc3135 Send symbolic typechecking goals involving != to the SMT solver.
Fixes #528.
2018-07-18 18:35:50 -07:00
Brian Huffman
7e34c25e4d Switch to infix syntax for blocks and padding operators.
"x /^ y" is x/y rounded up, i.e. the least n such that x <= y*n.
"x %^ y" is the least k such that x+k is a multiple of y.

For comparison,
"x / y" is x/y rounded down, i.e. the greatest n such that x >= y*n.
"x % y" is the least k such that x-k is a multiple of y.

The new syntax is much more suggestive of the relation to "/" and "%".
2017-09-28 10:26:31 -07:00
Brian Huffman
9bc6d02019 Implement blocks and padding operators for numeric types.
The design is as described in issue #96:

blocks msgLen blockSize = the least n such that msgLen <= blockSize * n
padding msgLen blockSize = least k such that msgLen + k divides blockSize

or alternatively:

msgLen + padding msgLen blockSize = blocks msgLen blockSize * blockSize
2017-09-27 13:43:26 -07:00
Iavor Diatchki
e5fa174cbb Add some axioms about width.
Fixes #387
2017-07-10 16:59:03 -07:00
Trevor Elliott
4dc5eda23a Expand the width table, and fix a bug in CryptoBox (Thanks @tommd)
The width table in CryptolTC.z3 wasn't large enough to solve constraints
about the width of 64-bit words. This change is a bit of a band-aid, as
larger words will expose the same problem. Longer-term, we should try to
solve these constraints after the SMT-based phase, using some other
approach.

The constraints in CryptoBox were too permissive, and when adjusted to
represent the true intent (that values fit within 64-bits), and the
width table was updated, the example will type-check again.

Thanks to @tommd for tracking both of these down.
2017-03-27 13:45:50 -07:00
Iavor S. Diatchki
41131fe7ed Redo the export to SMT story in a much simpler way. 2017-02-16 16:46:38 -08:00