-
Notifications
You must be signed in to change notification settings - Fork 49
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
Simple use of lemmas for preconditions (feature request?) #218
Comments
B(...) because lemma(...) as you say can be represented as:
But this would be nice to have the because statement. Would you think it would be clearer? |
assert would be a nice solution, but it doesn't seem to work on my code :( def insertBack(c: Core, t: Task): Core = {
require(!contains(c.tasks, t))
if(containsEquivLemma(c.tasks, t, tick(t))) {
Core(c.id, sortedIns(c.tasks, tick(t)), None[Task]())
} else {
error[Core]("Tick changes task id\n");
}
}
def insertBack2(c: Core, t: Task): Core = {
require(!contains(c.tasks, t))
assert(containsEquivLemma(c.tasks, t, tick(t)));
Core(c.id, sortedIns(c.tasks, tick(t)), None[Task]())
}
leon Scheduler.scala --functions=insertBack,insertBack2
// verifies insertBack but does not finish (precondition of sortedIns) on insertBack2 Am I missing something? |
@regb @colder @samarion @manoskouk |
@manoskouk disabled it (see TransformerWithPC). It's tagged with "to discuss", any reason we wouldn't want these? |
Imagine I have the following lemma:
and the following code:
What is the best way to make sure that Leon can prove that the new B can be built ? (The precondition for creating B holds because of the lemma.)
I was wondering if it would be possible to write something such as:
(Or have Leon remember what it "check(...)'ed" before.)
Sorry if a method already exists in Leon to do that or if the issue has already been raised! :)
The text was updated successfully, but these errors were encountered: