Re: Refal+ abstract syntax


Subject: Re: Refal+ abstract syntax
From: Sergei M. Abramov (abram@botik.ru)
Date: Fri Nov 26 1999 - 11:39:24 MSK


���� ������, ����!

> 2. ���� ������������������ ���������� ������� ��-
> ����������� ����� ������������, � �� ����� cons .

�� ������ "��" ��� "������" ������ ��������� �������: ������� ����� ��, ���
�����

   (x+y)*(z+w) � (* + z w + x y)

� ���� ����� ������ � ��������:

From: Andrey Slepuhin <pooh@msu.ru>
>2) ������������ ��������� ��������� ����� � ������������ ����. ��
> ������� ���� ����������� ���� "Label s" � ����������� ����������
> ����� �� �������� ��.

� ��������.

> 3. ��� ������, ������� ���������� �����, ����� ������� ����.
>
> 4. � �� ���� ����� ����� ���� � �������.

������ ������--"Form" � Form--������������

    (* ������� � � ������+ � ������� ��� ��� ������������? ��� ��� ���?
       ��, �� ������� ����, � ��������� ��������� ��� "�������" �
       "����� ����"--����� 80 ����� � 30/08/1999 �� 10/09/1999,--����
       ��� ���������� � ��� ���� ������ � ������+.
     *)

������ (���� �����!!!) ��� �������, ��� ����� ��������� � ���� �������������
�������:

>t.ProgramFile ::= (Program t.Source t.Import e.Program)
>
>t.Import ::= (Use e.Names)
>
>t.Source ::= (Source s.FileName)


>t.ProgramFile ::= ("Program" t.Source t.Import e.Program)
>
>t.Import ::= ("Use" e.Names)
>
>t.Source ::= ("Source" s.FileName)

���������� �� ������������� ������--����� (�����������) ���������� ����������� �
���������...
��� ���--��� ���� �����.

(* ------------------------------------------------------------
��� ������� � ������ �����+ ������: � � � ����� ����������� ����� ��� � ���:

>t.ProgramFile ::= (&Program t.Source t.Import e.Program)
>
>t.Import ::= (&Use e.Names)
>
>t.Source ::= (&Source s.FileName)

������ � ������ �����+ ������ t�gs.rfi:

$const Program = "Program", Use = "Use", Source="Source";

(������, ��� t�gs.rf ��� ���� ������, ���������, ������?) �� ����� �������
�����, ����� ���� ���������� ����������--������� ���==����� (�����+������ ���
�������� ���� �����...). ��� ���� (� ����������� ������+) ��������� ���� ��
�������� � ��������� ������ �������--�������� ��� ��������� ��������... � �����
������� � ���� ����������� ��������������:

$const Program = 1, Use = 2, Source=3;

��� �������� ������ (���==�����) � ����� ��������� ����� (������������ ������
������)...

------------------------------------------------------------ *)

> 5. ������� ����������� (�����������, ������������) ������� ��
> ������������ ��������.
>
> 6. ��������� �������� ������� � ���������� ����� � ���������
> ������ ���������� �������� (���������� ��������� ��
> ����������� ��������). �������� ������ ������� (�������,
> ����������, �������) � ������� (�����).
>
> 7. ���� ��������� �������� NoFail, ������������� ��� $Fail, �
> CUTALL, ���������� ��������� ��������� ������ +.
> ������������ ���� ���������� ���: NoFail
> (Block e.Branches).
>
> 8. $iter ����� ���� �������� � ����� ������������ �������
> (Label sl) � (Loop sl) ��.����. � ��������� Loop �����
> sl ������ ���� ������������ (���������� Label) ���� ��
> ���� �� ������ ������� � ������� ��������� Loop.
> ������ ��������� ����� Label � ��� �� ��������-������.
>
> 9. ������ ���� �������: Tail, Path, Source ����: e.Sentence.

������ 5, 6, 7, 8 ������� ��� (�������� ����������) � �. 2. ��. ��������� �� �.2
(� ������� <pooh@msu.ru>).

> 10. �������� ���: ��� ��� �����������.

���! � �� �������, ��� ��� ������� ���������!

������ ���������� ������+ (��� � ������-6) -- �������� ������� "�����������
������". ����������� "$const X = ... " � "&X" ��������� �������� ��� ������� ��
������ ��������. ������:

$const X = '1234567890',
       X1 = (&X) (&X),
       X2 = (&X1) (&X1),
       X3 = (&X2) (&X2),
       .....
       X64 = (&X65) (&X65);

F = &X64;

�� � ������ � ���������--����������:

    -1- ��� ��� �������� ������� � ���������� ������+? ����� 138 ������� �
�������� ������, �� ������ ��?;

    -2- � ��� ��� ����� ��������� � ����������� ����������, ���� �������
��������� "�������� ���: ��� ��� �����������"?

    -3- ��������� ���������: �������� ��, ����� ���-������ ������� � ������� ��
������ �������� ���� � ����������� ����������� ����������� ������� F � �������
"�������� ���: ��� ��� �����������" ;-)

(* ������ ��� �� ����������--� ���� ��������� ����--�� ���� ������� �����:
   10*2^64 ���� == 160 ��������� ��������� ������ ;-)
 *)

> �� ������: ��� �����
> ��� �������? � ��� �������� ������ ��������� ������ ��
> �������? ������ ������� ������? ��������� �����: ��� (Ref
> s.Word). ������������ ��������� �������� ������ ��� s.Word. �
> ������ ������� ������������ (Ref s.Word)

��! � ��� ������ ����� ��� ������������ ���������...

> 11. ����������� ��������-������ ������ ���� �����������
> ��������� ������ ����� ������.

��! � ��� ������ ����� ��� ������������ ���������...

> 12. ��������� ������� (� ������� �� ��������-������)
> �������������� ���� �����, � �� ��� (Symbol s)

��� ����� ������� ���� ��� ���������� ������� ������ ����� ������������ � �����
("Par" ....). ��� ������� � ����������� "t.HardTerm", �� ��������� (� ��
��������-��?) �

>t.PatternTerm ::= t.Symbol
> | (e.PatternExpression)
                          ^ Par?
> | t.Variable

��...

> 13. ��������� Error � Trap ����� ������� ��������������
> �������� ����������� ������ �� ���������.

��� ����� ��� �.2.

> 14. ������� ����� ���������� Fail � Loop ������������.

��� ����� ��� �.2.

> 15. ���������� ���������� ����� �� ������������ �����-��
> �������� (��� ��������� ���������) ������������ ����������. �
> ���� ������ ������ ���������� ������� ���������.

��.

>======================================================================
>
>t.ProgramFile ::= (Program t.Source t.Import e.Program)
>
>t.Import ::= (Use e.Names)
>
>t.Source ::= (Source s.FileName)

����!
    (1) �������� �� �����-�� ���������...
    (2) ����������� ������� ������������ ���������
    (3) ���� "������", �� ���� "��������"...

>e.Program ::= t.ProgramItem
> | e.Program t.ProgramItem
> | t.Line

    (1) ������� ���� ��������� ����� ���� ������;
    (2) �� �����, ��� ������, ��� ������, ��� ���� ������� ������ �� t.Line?
����� ���� ������� � ����, ��� ���� ����������� � "t.ProgramItem :== ..... |
t.Line" ?

>t.ProgramItem ::= t.FuncDef | t.ObjectDef | t.Initializer

    (1) ��, ����������, ���������� t.Initializer ;-) � ����� ��?
    (2) ������� �������� ������������ | t.Pragma

� �� ������ ���:

-�- � ������� ������ ����� ������� �� ��������� t.Line --> t.Pragma, � ������

>t.Line ::= (Line s.LineNumber s.PosNumber)
> | (Line s.LineNumber)

-�- � ������� ��:

t.Pragma ::= (Pragma e.Pragma)

e.Pragma ::= t.Line
                       | "Traseall"
                       | "Trase" e.Fnames
                       ......
                       | e.OtherPragma

t.Line ::= (Line s.LineNumber s.PosNumber)
                      | (Line s.LineNumber)

��, ������� � ��� (����--��� ������ ���������) ���������...

�����!

������



This archive was generated by hypermail 2b25 : Mon Oct 25 2004 - 21:24:58 MSD