Skip to content
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
10 changes: 1 addition & 9 deletions Source/Concurrency/YieldingProcDuplicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,7 @@ private void ProcessCallCmd(CallCmd newCall)
}
else if (IsRefinementLayer)
{
if (newCall.HasAttribute(CivlAttributes.SKIP))
{
var calleeRefinedAction = PrepareNewCall(newCall, yieldingProc);
InjectGate(calleeRefinedAction, newCall);
}
else
{
AddPendingAsync(newCall, yieldingProc);
}
AddPendingAsync(newCall, yieldingProc);
}
}
else
Expand Down
20 changes: 6 additions & 14 deletions Source/Core/AST/Commands/CallCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ void CheckModifies(IEnumerable<Variable> modifiedVars)
if (Proc is YieldProcedureDecl calleeDecl)
{
var isSynchronized = this.HasAttribute(CivlAttributes.SYNC);
var isSkipped = this.HasAttribute(CivlAttributes.SKIP);
if (calleeDecl.Layer > callerDecl.Layer)
{
tc.Error(this, "layer of callee must not be more than layer of caller");
Expand All @@ -320,12 +319,12 @@ void CheckModifies(IEnumerable<Variable> modifiedVars)
else
{
CheckModifies(highestRefinedActionDecl.ModifiedVars);
if (callerDecl.HasMoverType && highestRefinedActionDecl.Creates.Any())
{
tc.Error(this, "caller must not be a mover procedure");
}
if (!IsAsync)
{
if (highestRefinedActionDecl.Creates.Any() && callerDecl.HasMoverType)
{
tc.Error(this, "caller must not be a mover procedure");
}
// check there is no application of IS_RIGHT in the entire chain of refined actions
var calleeRefinedAction = calleeDecl.RefinedAction;
while (calleeRefinedAction != null)
Expand Down Expand Up @@ -363,16 +362,9 @@ void CheckModifies(IEnumerable<Variable> modifiedVars)
calleeRefinedAction = calleeActionDecl.RefinedAction;
}
}
else if (isSkipped)
else if (callerDecl.HasMoverType)
{
if (highestRefinedActionDecl.LayerRange.UpperLayer != callerDecl.Layer)
{
tc.Error(this, $"upper layer of action {highestRefinedActionDecl.Name} must be same as layer of caller");
}
else if (!highestRefinedActionDecl.IsSkippable())
{
tc.Error(this, $"action {highestRefinedActionDecl.Name} must be skippable");
}
tc.Error(this, "async call must be synchronized");
}
}
}
Expand Down
1 change: 0 additions & 1 deletion Source/Core/CivlAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public static class CivlAttributes
public const string HIDE = "hide";
public const string PENDING_ASYNC = "pending_async";
public const string SYNC = "sync";
public const string SKIP = "skip";
public const string IS_RIGHT = "IS_right";
public const string IS_LEFT = "IS_left";

Expand Down
15 changes: 15 additions & 0 deletions Test/civl/regression-tests/issue-1005.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// RUN: %parallel-boogie "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

left action {:layer 1, 100} voting_action ()
{
}

yield procedure {:layer 0} voting_procedure ();
refines voting_action;


yield left procedure {:layer 100} voting_loop_yield_procedure()
{
async call voting_procedure();
}
2 changes: 2 additions & 0 deletions Test/civl/regression-tests/issue-1005.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
issue-1005.bpl(14,10): Error: async call must be synchronized
1 type checking errors detected in issue-1005.bpl
26 changes: 0 additions & 26 deletions Test/civl/regression-tests/refinement3.bpl

This file was deleted.

5 changes: 0 additions & 5 deletions Test/civl/regression-tests/refinement3.bpl.expect

This file was deleted.

Loading