Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :exhaust #94

Closed
acfoltzer opened this issue Sep 9, 2014 · 4 comments
Closed

Add :exhaust #94

acfoltzer opened this issue Sep 9, 2014 · 4 comments
Assignees
Labels
feature request Asking for new or improved functionality
Milestone

Comments

@acfoltzer
Copy link
Contributor

A la Cryptol 1, we should have an exhaustive checking mode.

@acfoltzer acfoltzer added the feature request Asking for new or improved functionality label Sep 9, 2014
@LeventErkok
Copy link
Contributor

Indeed. And also note that Cryptol-1 did this "in-parallel." That is, instead of testing one-by-one, you test 64 inputs (assuming you're on a 64 bit machine) in one go. The code is in there in the old repo, but I could be bribed with a sufficient number of beers should it be necessary to explain the obvious magic in detail.

@TomMD
Copy link
Contributor

TomMD commented Sep 10, 2014

Pssst. @LeventErkok ... want beer on Wednesday?

@LeventErkok
Copy link
Contributor

@TomMD: That might be a possibility.. I'll watch the beers list communication tomorrow!

I think I jumped the gun there a bit with the parallel-exhaust comment. Now that I think about it, the parallel execution was done by first generating an AIG, and then interpreting that in parallel, by taking advantage of the fact that all you need to interpret an AIG is the AND operation and the NOT operation, both of which easily parallelize. So, if you have 10 bits of inputs, instead of running from 0 to 1023, you keep 10 64-bit machine words, and then use each bit to represent the next possible value of one of the inputs. That way you can test all those values in parallel, as the underlying machine can do 64-bit AND and 64-bit NOT in one machine instruction. I hope that's clear, if not we can talk about it later.

(You can do this in Haskell using Integer in one go as well, naturally, but that'd beat the purpose of going fast using the underlying machine's 64-bit instructions. I hope that's obvious.)

Of course, translating to AIG also has the advantage of getting rid of all the interpretative overhead associated with interpreting the Cryptol IR; which really pays off as :exhaust needs to keep interpreting the same thing over and over.

But of course, I don't think Cryptol-2 has the AIG-generation capabilities of Cryptol-1, so this option may not be available to you directly. On the other hand, I bet @weaversa would love this, as it would open the door to talking to ABC directly as well: Once you have the internal AIG's generated, it's rather a simple matter to hook it up to ABC, at least using the file-system.

@kiniry kiniry added this to the Cryptol 2.1 milestone Sep 12, 2014
acfoltzer added a commit that referenced this issue Sep 14, 2014
Reopens #94; the book talks about using :e to edit files, and having :exhaust in the command trie breaks this. We need to figure out a better way to disambiguate (#90)
@acfoltzer acfoltzer reopened this Sep 14, 2014
@kiniry kiniry modified the milestones: Cryptol 2.1, Cryptol 2.2 Sep 23, 2014
acfoltzer pushed a commit that referenced this issue Oct 1, 2014
Previously, if one command was a prefix of another command, that would lead to an ambiguous lookup from the command trie. Now there are two ways to look up: one works like previously, which is good for tab-completion, and the other will only return one result if there is an exact match.

This means we can now have multiple forms of each command, so we can explicitly have short forms like :e -> :edit that won't be changed just based on what names we give to future commands.

This closes #90, and also #94 which was blocked on this due to :exhaust and :edit conflicting.
acfoltzer pushed a commit that referenced this issue Oct 1, 2014
@acfoltzer
Copy link
Contributor Author

Forgot to close this back on 95bb27b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Asking for new or improved functionality
Projects
None yet
Development

No branches or pull requests

4 participants