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

How do we handle failure / divergence properly? #130

Open
septract opened this issue Jan 18, 2017 · 2 comments
Open

How do we handle failure / divergence properly? #130

septract opened this issue Jan 18, 2017 · 2 comments
Assignees

Comments

@septract
Copy link
Owner

Right now in the Starling input language, we can't write partial commands, eg. assert(x==1) or similar. This is because Starling's two-state representation doesn't have a way of expressing command failure: if a pre-state isn't defined, this is interpreted as divergence.

It's not clear what the semantics of failure should be. Perhaps we should map the pre-state to all post-states, i.e. model it as havoc? Do we need an explicit failure state? We should probably talk to the UTP people about this...

@MattWindsor91
Copy link
Collaborator

In the UTP world I think this is generally handled with a special variable ok that is supposed to be held true always (and setting it to false models nontermination/divergence).

@MattWindsor91
Copy link
Collaborator

As per what I said in #123, what I think we could do is add a directive, something like

with assert;

which will desugar (once we have custom command semantics, which is probably not quite in scope yet) to

shared bool ok; // fresh name?
constraint emp -> ok; // conjoins with existing emp
command assert(bool condition) { ok <- condition; }
command error() { ok <- false; }

This seems like it'd be the least theoretically nauseous way of doing this. (Ideally I'd want this to be opt-in, so that 'ok' and the emp constraint on it don't appear in proofs of non-failing programs).

For now we'd probably have assert and error as native commands.

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

2 participants