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

Reinstate History.pvl #662

Merged
merged 3 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
// -*- tab-width:2 ; indent-tabs-mode:nil -*-
//:: cases HistoryLoop

//:: cases HistoryDefined
//:: suite problem-fail
//:: tools silicon
//:: options --check-defined
//:: verdict Pass

//:: cases HistoryAxioms
//:: suite problem-fail
//:: tools silicon
//:: options --check-axioms

/*
Checking the correctness of the defined processes and/or axioms is disabled due
refactoring.
*/
//:: verdict Pass

class History {

int x;

modifies x;
Expand Down Expand Up @@ -45,6 +38,5 @@ class History {
requires m>=0 && n >= 0 ;
ensures single(m)*single(n)==single(m+n);
void single_axiom(int m,int n);

}

2 changes: 1 addition & 1 deletion src/main/java/vct/col/rewrite/CheckProcessAlgebra.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private ASTNode left_merge(ASTNode m_body, ASTNode other) {
}
for(ASTNode n:m0.getArgs()) args.add(n);
for(ASTNode n:m1.getArgs()) args.add(n);
ASTNode guess=create.invokation(null,null,merged,args.toArray(new ASTNode[0]));
ASTNode guess=create.invokation(create.reserved_name(ASTReserved.This),null,merged,args.toArray(new ASTNode[0]));
return create.expression(StandardOperator.Mult,p0,guess);
}
case ITE:{
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/vct/col/rewrite/RandomizedIf.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public RandomizedIf(ProgramUnit source) {
public void visit(ASTClass cl){
DeclarationStatement args[]=new DeclarationStatement[0];
Method if_any_method=create.method_decl(create.primitive_type(PrimitiveSort.Boolean), null, "if_any_random", args, null);

if_any_method.setFlag(ASTFlags.FINAL, true);

if (if_any_method.getOrigin() == null) {
if_any_method.setOrigin(new MessageOrigin("Default origin"));
}
Expand Down Expand Up @@ -66,7 +67,7 @@ public void visit(IfStatement s){
IfStatement res=new IfStatement();
currentBlock.addStatement(
create.assignment(create.local_name("if_any_bool"),
create.invokation(null,null,"if_any_random"))
create.invokation(create.reserved_name(ASTReserved.This),null,"if_any_random"))
);
res.addClause(create.local_name("if_any_bool"), rewrite(s.getStatement(0)));
res.addClause(IfStatement.elseGuard(), rewrite(s.getStatement(1)));
Expand Down