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 last section, 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!
Remark: The Varphi Interpreter does not produce any output when you execute it on an input program, since it will be waiting for the input tape on standard input. No prompt appears that asks for this. It is common to confuse this as the interpreter "loading" or "hanging," when in reality it is just waiting for the input tape.
Now recall the output convention from the last section:
The Varphi interpreter automatically prints out all tape cells that have ever been accessed. This includes tape cells that have been written to (even when writing the input tape) and read from.
This guide assumes you have already have the Varphi Interpreter (vpi) installed on your machine. If not, please refer to the .
We'll now run this program on our example from the last section, where we added and . To do so, run the following command
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 )!