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

protocol redundancy remover #32

Open
rolph-recto opened this issue Aug 19, 2019 · 0 comments
Open

protocol redundancy remover #32

rolph-recto opened this issue Aug 19, 2019 · 0 comments
Assignees

Comments

@rolph-recto
Copy link
Collaborator

There are certain situations where redundant PDG nodes are selected protocols, which makes selection slower.

Scenario 1: redundant queries

The following generates two queries to shell, manifest in the ANF translation:

if (1 <= shell && shell <= 3) { ... }

ANF translation:

let tmp1 = shell.get()
let tmp2 = shell.get()
let tmp3 = 1 <= tmp1
let tmp4 = tmp2 <= 3
let tmp5 = tmp3 && tmp4
if (tmp5) { ... }

but since it's impossible for shell to be modified in the middle of evaluating the expression, this can be a single query. Like so:

let tmp1 = shell.get()
let tmp3 = 1 <= tmp1
let tmp4 = tmp1 <= 3
let tmp5 = tmp3 && tmp4
if (tmp5) { ... }

Scenario 2: downgrades

Downgrades are useless after label inference, so they can be removed.

Example:

let tmp1 = x
let tmp2 = downgrade(x, {...})
if (tmp2) { ... }

Can be rewritten as:

let tmp1 = x
if (tmp1) { ... }

The solution is to have a redundancy removal pass before generating the PDG.

@rolph-recto rolph-recto self-assigned this Jun 12, 2020
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

No branches or pull requests

1 participant