unit Automat;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Keller;
type
TAutomat =
class
constructor create;
function proof(input:char):boolean;
end;
TEingabe = (eA,eB,eI);
TZustand = (zS,zA,zB,zF);
TKellerZustand = (s,m);
TUebergang =
record
NZustand:TZustand;
Kellerops:integer;
end;
TUebergangstabelle =
array [TEingabe,TZustand,TKellerzustand]
of (TUebergang.NZustand,TUebergang.Kellerops);
const
UeT : TUebergangstabelle = (
(((zA),(1)),((zB),(1)),((zF),(0))),
// Keller: s zS
(((zF),(0)),((zF),(0)),(zF,(0))),
// s zA
(((zF),(0)),((zF),(0)),(zF,(0))),
// s zB
(((zF),(0)),((zF),(0)),(zF,(0))),
// s zF
(((zF),(0)),((zF),(0)),(zF,(0))),
// m zS
(((zA),(1)),((zA),(-1)),(zF,(0))),
// m zA
(((zB),(-1)),((zB),(1)),(zF,(0))),
// m zB
(((zF),(0)),((zF),(0)),(zF,(0))),
// m zF
);
var
e : TEingabe;
z : TZustand;
k : TKellerzustand;
AKeller : TKeller;
AUebergang : TUebergang;
implementation
constructor create;
begin
inherited create;
AKeller := TKeller.create;
z := zS;
k := s;
end;
function proof(input:char):boolean;
var
i,n: integer;
begin
n := length(input);
for i := 1
to n
do
begin
e := input[i];
AUebergang
end
end;
end.