-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
DistAlgo version: 1.1.0b13
The use of 'original_message' and 'original_to' as arguments to the 'send' method must add value of 'original_message' and 'original_to' to the sent message sequence.
However, it does not support this behavior.
For example, ping.da is modified to illustrate this issue:
import sys
class Pong(process):
def setup(total_pings:int): pass
def run():
await(total_pings == 0)
def receive(msg=('Ping',), from_=p):
output("Pinged")
send(('Pong',), to=p)
total_pings -= 1
class Ping(process):
def setup(p:Pong, nrounds:int): pass
def run():
for i in range(nrounds):
clk = logical_clock()
send(('Ping',), to=p, original_message=('Test',), original_to=self)
await(some(received(('Pong',), clk=rclk), has=(rclk > clk)))
output('Checking whether sent sequence contains original_message:')
output(some(sent(('Test',)), has = True))
def receive(msg=('Pong',)):
output("Ponged.")
def receive(msg=('Test',)):
output('Received test')
def main():
nrounds = int(sys.argv[1]) if len(sys.argv) > 1 else 3
npings = int(sys.argv[2]) if len(sys.argv) > 2 else 3
config(clock='Lamport')
pong = new(Pong, [npings], num= 1)
ping = new(Ping, num= 1)
setup(ping, (pong, nrounds))
start(pong)
start(ping)
Output:
The above program must report "Checking if Test is sent: True" but it reports report "Checking if Test is sent: False"
Metadata
Metadata
Assignees
Labels
No labels