GaloisInc / saw-script

The SAW scripting language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `mir_equal` and `jvm_equal` commands, similar to `llvm_equal`

RyanGlScott opened this issue · comments

The LLVM backend includes an llvm_equal command for equating two values:

sawscript> :? llvm_equal
Description
-----------

    llvm_equal : SetupValue -> SetupValue -> LLVMSetup ()

State that two LLVM values should be equal. Can be used as either a
pre-condition or a post-condition. It is semantically equivalent to
an `llvm_precond` or `llvm_postcond` statement which is an equality
predicate, but potentially more efficient.

Under the hood, llvm_equal desugars to SetupCond_Equal. As it turns out, the JVM and MIR backends handle SetupCond_Equal internally as well, but neither backend offers a jvm_equal or mir_equal function to let users actually make use of it. We should add these functions.