10000 Getting cardinality from relations · Issue #69 · kenmcmil/ivy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Getting cardinality from relations #69

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

Open
jyao15 opened this issue Sep 14, 2022 · 0 comments
Open

Getting cardinality from relations #69

jyao15 opened this issue Sep 14, 2022 · 0 comments

Comments

@jyao15
Copy link
jyao15 commented Sep 14, 2022

Consider the following protocol.

type node
relation active(N:node)
type int_t
interpret int_t -> int
individual num_active : int_t

after init {
    active(N) := false;
    num_active := 0;
}

action become_active(n:node) = {
    require ~active(n);
    active(n) := true;
    num_active := num_active + 1;
}

The protocol maintains two invariants

invariant num_active <= COUNT n WHERE active(n) is defined (i.e., total number of nodes)
invariant num_active = COUNT n WHERE active(n) is true (i.e., number of active nodes)

However, I cannot find a way to represent either number in Ivy. Does Ivy support reasoning about cardinality of types/relations?

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
0