Skip to content

Introduce sorts for smt expressions.#3234

Merged
axic merged 2 commits intodevelopfrom
sortsForExpressions
Nov 27, 2017
Merged

Introduce sorts for smt expressions.#3234
axic merged 2 commits intodevelopfrom
sortsForExpressions

Conversation

@chriseth
Copy link
Contributor

This will fix the assertion failures on MacOS. More specifically: It fixes assertion failures related to the smt solver when z3 is not found at build time.

It will not fix the tests themselves, because we do not have a way to invoke the smt solver on macos yet.

@@ -44,18 +44,18 @@ enum class CheckResult

enum class Sort
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does sort means here? Is it kind but the lingo in SMT is sort?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but z3 calls this "sort"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expression operator()(Expression _a) const
{
solAssert(sort == Sort::IntIntFun, "Attempted function application to non-function.");
solAssert(arguments.empty(), "Attempted function application to non-function.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could merge these two? Does the second assert make any sense though? Wouldn't it be enough on its own?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep it for now, until we have proper function sort support. it might be removed in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could merge it in that case sort == Sort::IntIntFun && arguments.empty(). But doesn't IntIntFun have a signle argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, arguments are empty because this is the plain function and we apply the argument _a by calling the operator.

enum class Sort
{
Int, Bool
Int, Bool, IntIntFun
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does IntIntFun means it is a function with a single Int input and single Int output? Would a comment here help?

@axic axic added the feature label Nov 22, 2017
@chriseth
Copy link
Contributor Author

Changed.

@chriseth chriseth force-pushed the sortsForExpressions branch from 26f05d3 to 0e2a965 Compare November 23, 2017 18:03
@axic
Copy link
Contributor

axic commented Nov 27, 2017

Test failures are due to the Zeppelin issue.

@axic axic merged commit a7136db into develop Nov 27, 2017
@axic axic deleted the sortsForExpressions branch November 27, 2017 13:56
@axic axic removed the in progress label Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants