File: type.grm

package info (click to toggle)
hol88 2.02.19940316dfsg-5
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 65,816 kB
  • sloc: ml: 199,939; ansic: 9,666; sh: 6,913; makefile: 6,032; lisp: 2,747; yacc: 894; sed: 201; cpp: 87; awk: 5
file content (38 lines) | stat: -rw-r--r-- 1,197 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
tyname --> {mk_type_name(TOKEN)}.

tyvar --> {mk_type_var(TOKEN)}.

typ --> type1 more_type.

more_type --> [#] {add_to_list(type1,POP)} more_prod_type sum_or_fun_type
            | [->] {MK_bin_type(`fun`,POP,typ)}
            | [+] type1 more_sum_type fun_type
            | [].

more_prod_type --> [#] {add_to_list(type1,POP)} more_prod_type
                 | {MK_defd_type(POP,`prod`)}.

sum_or_fun_type --> [+] {MK_bin_type(`sum`,POP,typ)}
                  | [->] {MK_bin_type(`fun`,POP,typ)}
                  | [].

more_sum_type --> [+] {add_to_list_rev(POP,POP)} type1 more_sum_type
                | [#] {add_to_list(type1,POP)} 
                  more_prod_type more_sum_type
                | {add_to_list_rev(POP,POP)} {MK_defd_type(POP,`sum`)}.

fun_type --> [->] {MK_bin_type(`fun`,POP,typ)}
           | [].

type1 --> [(] typ poss_cmpnd_type
        | tyname more_type1
        | tyvar more_type1.

poss_cmpnd_type --> [)] more_type1
                  | [,] {add_to_list(POP,typ)} rest_of_cmpnd.

rest_of_cmpnd --> [,] {add_to_list(POP,typ)} rest_of_cmpnd
                | [)] {MK_type(POP,TOKEN)} more_type1.

more_type1 --> {MK_type(POP,TOKEN)} more_type1
             | [].