Skip to content

Commit

Permalink
allow names for actions in refines clause
Browse files Browse the repository at this point in the history
  • Loading branch information
shazqadeer committed Nov 20, 2024
1 parent b709fa4 commit 3b68356
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
7 changes: 3 additions & 4 deletions Source/Core/BoogiePL.atg
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,9 @@ SpecRefinedActionForYieldProcedure<.ref ActionDeclRef refinedAction, IToken name
Ident<out m>
ImplBody<out locals, out stmtList>
(.
if (m.val != "_") {
this.SemErr("expected _ for name of anoonymous action");
} else if (refinedAction == null) {
var actionDecl = new ActionDecl(tok, null, moverType, Formal.StripWhereClauses(ins), Formal.StripWhereClauses(outs),
if (refinedAction == null) {
var actionName = m.val == "_" ? null : m.val;
var actionDecl = new ActionDecl(tok, actionName, moverType, Formal.StripWhereClauses(ins), Formal.StripWhereClauses(outs),
false, new List<ActionDeclRef>(), null, null,
new List<Requires>(), new List<CallCmd>(), new List<AssertCmd>(), new List<IdentifierExpr>(), null, akv);
Pgm.AddTopLevelDeclaration(actionDecl);
Expand Down
7 changes: 3 additions & 4 deletions Source/Core/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,10 +1235,9 @@ void SpecRefinedActionForYieldProcedure(ref ActionDeclRef refinedAction, IToken
}
Ident(out m);
ImplBody(out locals, out stmtList);
if (m.val != "_") {
this.SemErr("expected _ for name of anoonymous action");
} else if (refinedAction == null) {
var actionDecl = new ActionDecl(tok, null, moverType, Formal.StripWhereClauses(ins), Formal.StripWhereClauses(outs),
if (refinedAction == null) {
var actionName = m.val == "_" ? null : m.val;
var actionDecl = new ActionDecl(tok, actionName, moverType, Formal.StripWhereClauses(ins), Formal.StripWhereClauses(outs),
false, new List<ActionDeclRef>(), null, null,
new List<Requires>(), new List<CallCmd>(), new List<AssertCmd>(), new List<IdentifierExpr>(), null, akv);
Pgm.AddTopLevelDeclaration(actionDecl);
Expand Down
9 changes: 0 additions & 9 deletions Test/civl/regression-tests/anonymous-action-fail.bpl

This file was deleted.

2 changes: 0 additions & 2 deletions Test/civl/regression-tests/anonymous-action-fail.bpl.expect

This file was deleted.

2 changes: 1 addition & 1 deletion Test/civl/regression-tests/anonymous-action.bpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ refines both action {:layer 2} _ {
}

yield procedure {:layer 0} C(i: int) returns (j: int);
refines both action {:layer 1} _ {
refines both action {:layer 1} AC {
call Incr();
}

Expand Down

0 comments on commit 3b68356

Please sign in to comment.