File : ffa_calc.ads
1 ------------------------------------------------------------------------------
2 ------------------------------------------------------------------------------
3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
4 -- --
5 -- (C) 2019 Stanislav Datskovskiy ( www.loper-os.org ) --
6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
7 -- --
8 -- You do not have, nor can you ever acquire the right to use, copy or --
9 -- distribute this software ; Should you use this software for any purpose, --
10 -- or copy and distribute it to anyone or in any manner, you are breaking --
11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
12 -- continue doing so for the indefinite future. In any case, please --
13 -- always : read and understand any software ; verify any PGP signatures --
14 -- that you use - for any purpose. --
15 -- --
16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
17 ------------------------------------------------------------------------------
18 ------------------------------------------------------------------------------
19
20 with Limits; use Limits;
21 with FFA_RNG; use FFA_RNG;
22
23
24 package FFA_Calc is
25
26 -- Peh Tapes:
27 subtype Peh_Tape_Range is Positive range 1 .. Max_Peh_TapeSpace;
28 type Peh_Tapes is array(Peh_Tape_Range range <>) of Character;
29
30 -- Possible Verdicts of a non-erroneous Peh Tape run:
31 type Peh_Verdicts is (Yes, No, Mu);
32
33 -- Operator-Selectable Spatial and Time Dimensions of a Peh Machine:
34 type Peh_Dimensions is
35 record
36 Width : Positive;
37 Height : Positive;
38 TapeSpace : Peh_Tape_Range;
39 Life : Natural;
40 end record;
41
42 -- Valid indices into the Control Stack:
43 subtype ControlStack_Range is Natural range 0 .. Peh_Control_Stack_Size;
44 -- The 'zero' position, as with the Data Stack, indicates 'emptiness'
45 -- when pointed to by CSP ( see ffa_calc.adb ) and is never accessed.
46
47 -- Valid indices into the Subroutine Table:
48 subtype Subroutine_Table_Range is Natural range 0 .. Subroutine_Table_Size;
49 -- The 'zero' position indicates 'emptiness', as in the above.
50
51 -- Ensure that requested Peh Dimensions are permissible. Terminate if not.
52 procedure Validate_Peh_Dimensions(Dimensions : in Peh_Dimensions);
53
54 -- Start a Peh Machine with the given Dimensions and Tape; return a Verdict.
55 function Peh_Machine(Dimensions : in Peh_Dimensions;
56 Tape : in Peh_Tapes;
57 RNG : in RNG_Device) return Peh_Verdicts;
58
59 end FFA_Calc;