add two numbers

12 views
Skip to first unread message

Shakirullah Shah

unread,
Nov 22, 2021, 1:12:16 PM11/22/21
to ProB Users
Dear All,
How can I write machine to add two numbers and display their output?
Any help will highly appreciated.

Best
Shakir

Shakirullah Shah

unread,
Dec 4, 2021, 3:01:40 PM12/4/21
to ProB Users
Am I going in right direction? I will really appreciate if someone guide me standard/professional approach for it.

MACHINE SumofTwoNum
VARIABLES num1,num2
INVARIANT num1:INT & num2:INT
INITIALIZATION
num1,num2:=10,20
OPERATIONS
answer<--add =
answer:=num1+2
END

Thanks in advance :)

Michael Leuschel

unread,
Dec 6, 2021, 11:17:58 AM12/6/21
to Shakirullah Shah, ProB Users
Hi,

I am not really sure what you are intending to do.
There is a typo in your operation add, it should be
num1+num2 instead of num1+2

Some example models are available at the bottom of this site:
https://prob.hhu.de/w/index.php?title=User_Manual

Greetings,
Michael
> --
> You received this message because you are subscribed to the Google Groups "ProB Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prob-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prob-users/1cdbadf6-6b3a-4f87-b6e7-bd4e7da10567n%40googlegroups.com.

Shakirullah Shah

unread,
Dec 7, 2021, 12:46:47 PM12/7/21
to ProB Users
Hi
Thanks Michael for the correction. I just want to learn basics B specification skills.
I don't how to take start. I need guidance. 

Regards
Shakir
Reply all
Reply to author
Forward
0 new messages