Last active
October 27, 2022 18:28
-
-
Save bgogul/6d5cb4bd10bfd4e529ae3eede0e3501d to your computer and use it in GitHub Desktop.
high-level syntax for policy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Mapping IR operation to action. | |
op.action.name | |
op.action.data | |
op.action. | |
op is "egress" on y by blah if { | |
let operation = op.operator_name in | |
let x = op.args[0] in | |
let y = op.args[1] in | |
operation = "send_data_to_network", | |
x = " | |
} | |
action egress { | |
// The following properties are always available. | |
op: Operation, | |
data: AccessPath, | |
// Additional properties. | |
destination: String?, | |
} | |
egress contains action_desc if { | |
some op in Operations, | |
op.operator = "send_data_to_network", | |
data = op.args[0], | |
destination := op.args[1]:constant, | |
action_desc := { | |
op: op, | |
data: data, | |
destination: destination, | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment