Running Varphi Programs
Last updated
Was this helpful?
Last updated
Was this helpful?
The Varphi Interpreter does not explicitly check for a particular extension for input files. However, it is considered a good practice to use the .vp extension anyways.
For this guide, we'll use the Varphi program that we created from the , where we add two positive integers. For your convenience, we have included it below (the version without comments):
The first step is to create a file and save this code to it. We'll assume the file's name is add.vp
, but feel free to name it anything you wish!
We'll now run this program on our example from the last section, where we added and . To do so, run the following command
Now recall the output convention from the last section:
You should notice that no output is produced, for the interpreter is waiting for you to provide the input tape. Since we're adding and , the input tape is 111011
(remember, 0
represents a blank tape cell, not a tape cell with the character "0"). Type this string into your terminal and hit ENTER. The output tape should then be printed on the terminal.
There shall only be one contiguous block of tallies, which will represent the output of the Turing machine. If there are tallies in the contiguous block, then the number being represented by the tape is .
Under this output convention, the output tape, 000011111
, represents the decimal number , which is a correct result (as )!