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

Write stack multiset check constraints in AirScript #272

Draft
wants to merge 12 commits into
base: andrew-stack-general-constraints
Choose a base branch
from

Conversation

Fumuran
Copy link
Contributor

@Fumuran Fumuran commented Apr 25, 2023

Partially addressing: #203
This PR adds multiset check constraints for stack operations and removes keywords from evaluator function declaration.

@Fumuran Fumuran force-pushed the andrew-stack-multiset-constraints branch from e48e04b to fdc45a1 Compare April 26, 2023 10:17
Comment on lines 241 to 250
ev u32and_bus_constraint([stack_top[16]], [b_chip]):
# and_req_val represents bitwise operation request value.
let and_req_val = $alpha[0] +
$alpha[1] * BITWISE_AND +
$alpha[2] * stack_top[0] +
$alpha[3] * stack_top[1] +
$alpha[4] * stack_top[0]'

# Enforce u32and bus constraint.
enf b_chip' * and_req_val = b_chip
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we can write bus constraints this way. This captures only one half of the constraint (the request part) but we need to capture both parts (request and response) in the same constraint.

What we should probably do is to create a separate file for each bus and describe bus constraints there fully.

@Fumuran Fumuran marked this pull request as draft May 2, 2023 10:40
@Fumuran Fumuran removed request for bitwalker, grjte and tohrnii May 2, 2023 10:40
@Fumuran Fumuran force-pushed the andrew-stack-general-constraints branch from 0f3097d to 445393e Compare June 6, 2023 13:43
@Fumuran Fumuran force-pushed the andrew-stack-general-constraints branch 3 times, most recently from f2a39c2 to 146c947 Compare June 21, 2023 18:00
@Fumuran Fumuran force-pushed the andrew-stack-multiset-constraints branch from fdc45a1 to 793e0a6 Compare June 21, 2023 18:14
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