summaryrefslogtreecommitdiff
path: root/test/spass/dfgparser.c
blob: 54bcea63532fbc5a7484bba3becb656af16e5d8c (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
/* A Bison parser, made from dfgparser.y, by GNU bison 1.75.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* Written by Richard Stallman by simplifying the original so called
   ``semantic'' parser.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output.  */
#define YYBISON	1

/* Pure parsers.  */
#define YYPURE	0

/* Using locations.  */
#define YYLSP_NEEDED 0

/* If NAME_PREFIX is specified substitute the variables and functions
   names.  */
#define yyparse dfg_parse
#define yylex   dfg_lex
#define yyerror dfg_error
#define yylval  dfg_lval
#define yychar  dfg_char
#define yydebug dfg_debug
#define yynerrs dfg_nerrs


/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     DFG_AND = 258,
     DFG_AUTHOR = 259,
     DFG_AXIOMS = 260,
     DFG_BEGPROB = 261,
     DFG_BY = 262,
     DFG_CLAUSE = 263,
     DFG_CLOSEBRACE = 264,
     DFG_CLSLIST = 265,
     DFG_CNF = 266,
     DFG_CONJECS = 267,
     DFG_DATE = 268,
     DFG_DECLLIST = 269,
     DFG_DESC = 270,
     DFG_DESCLIST = 271,
     DFG_DNF = 272,
     DFG_DOMPRED = 273,
     DFG_ENDLIST = 274,
     DFG_ENDPROB = 275,
     DFG_EQUAL = 276,
     DFG_EQUIV = 277,
     DFG_EXISTS = 278,
     DFG_FALSE = 279,
     DFG_FORMLIST = 280,
     DFG_FORMULA = 281,
     DFG_FORALL = 282,
     DFG_FREELY = 283,
     DFG_FUNC = 284,
     DFG_GENERATED = 285,
     DFG_GENSET = 286,
     DFG_HYPOTH = 287,
     DFG_IMPLIED = 288,
     DFG_IMPLIES = 289,
     DFG_LOGIC = 290,
     DFG_NAME = 291,
     DFG_NOT = 292,
     DFG_OPENBRACE = 293,
     DFG_OPERAT = 294,
     DFG_OR = 295,
     DFG_PREC = 296,
     DFG_PRED = 297,
     DFG_PRDICAT = 298,
     DFG_PRFLIST = 299,
     DFG_QUANTIF = 300,
     DFG_SATIS = 301,
     DFG_SETFLAG = 302,
     DFG_SETTINGS = 303,
     DFG_SYMLIST = 304,
     DFG_SORT = 305,
     DFG_SORTS = 306,
     DFG_STATUS = 307,
     DFG_STEP = 308,
     DFG_SUBSORT = 309,
     DFG_TERMLIST = 310,
     DFG_TRUE = 311,
     DFG_UNKNOWN = 312,
     DFG_UNSATIS = 313,
     DFG_VERSION = 314,
     DFG_NUM = 315,
     DFG_MINUS1 = 316,
     DFG_ID = 317,
     DFG_TEXT = 318
   };
#endif
#define DFG_AND 258
#define DFG_AUTHOR 259
#define DFG_AXIOMS 260
#define DFG_BEGPROB 261
#define DFG_BY 262
#define DFG_CLAUSE 263
#define DFG_CLOSEBRACE 264
#define DFG_CLSLIST 265
#define DFG_CNF 266
#define DFG_CONJECS 267
#define DFG_DATE 268
#define DFG_DECLLIST 269
#define DFG_DESC 270
#define DFG_DESCLIST 271
#define DFG_DNF 272
#define DFG_DOMPRED 273
#define DFG_ENDLIST 274
#define DFG_ENDPROB 275
#define DFG_EQUAL 276
#define DFG_EQUIV 277
#define DFG_EXISTS 278
#define DFG_FALSE 279
#define DFG_FORMLIST 280
#define DFG_FORMULA 281
#define DFG_FORALL 282
#define DFG_FREELY 283
#define DFG_FUNC 284
#define DFG_GENERATED 285
#define DFG_GENSET 286
#define DFG_HYPOTH 287
#define DFG_IMPLIED 288
#define DFG_IMPLIES 289
#define DFG_LOGIC 290
#define DFG_NAME 291
#define DFG_NOT 292
#define DFG_OPENBRACE 293
#define DFG_OPERAT 294
#define DFG_OR 295
#define DFG_PREC 296
#define DFG_PRED 297
#define DFG_PRDICAT 298
#define DFG_PRFLIST 299
#define DFG_QUANTIF 300
#define DFG_SATIS 301
#define DFG_SETFLAG 302
#define DFG_SETTINGS 303
#define DFG_SYMLIST 304
#define DFG_SORT 305
#define DFG_SORTS 306
#define DFG_STATUS 307
#define DFG_STEP 308
#define DFG_SUBSORT 309
#define DFG_TERMLIST 310
#define DFG_TRUE 311
#define DFG_UNKNOWN 312
#define DFG_UNSATIS 313
#define DFG_VERSION 314
#define DFG_NUM 315
#define DFG_MINUS1 316
#define DFG_ID 317
#define DFG_TEXT 318




/* Copy the first part of user declarations.  */
#line 48 "dfgparser.y"


#include <ctype.h>
#include "dfg.h"
#include "symbol.h"
#include "term.h"
#include "foldfg.h"
#include "stringsx.h"

/* Used for the texts from description section. */
typedef struct {
  char*     name;
  char*     author;
  char*     version;
  char*     logic;
  DFG_STATE status;
  char*     description;
  char*     date;
} DFG_DESCRIPTIONTYPE;

static DFG_DESCRIPTIONTYPE dfg_DESC;
static LIST                dfg_AXIOMLIST;
static LIST                dfg_CONJECLIST;
static LIST                dfg_SORTDECLLIST;
/* symbol precedence explicitly defined by user */
static LIST                dfg_USERPRECEDENCE;
static LIST                dfg_AXCLAUSES;
static LIST                dfg_CONCLAUSES;
static LIST                dfg_PROOFLIST;     /* list_of_proofs */
static LIST                dfg_TERMLIST;      /* list_of_terms  */
static BOOL                dfg_IGNORE;      /* tokens are ignored while TRUE */
static FLAGSTORE           dfg_FLAGS;
static PRECEDENCE          dfg_PRECEDENCE;

/* used also in the scanner */
NAT                        dfg_LINENUMBER;
BOOL			   dfg_IGNORETEXT;

void yyerror(const char*);
int  yylex(void);		/* Defined in dfgscanner.l */

static void   dfg_SymbolDecl(int, char*, int);
static SYMBOL dfg_Symbol(char*, NAT);
static void   dfg_SubSort(char*, char*);
static void   dfg_SymbolGenerated(SYMBOL, BOOL, LIST);

static __inline__ TERM dfg_TermCreate(char* Name, LIST Arguments)
/* Look up the symbol, check its arity and create the term */
{
  SYMBOL s;
  NAT    arity;
  arity = list_Length(Arguments);
  s = dfg_Symbol(Name, arity); /* Frees the string */
  if (!symbol_IsVariable(s) && !symbol_IsFunction(s)) {
    misc_StartUserErrorReport();
    misc_UserErrorReport("\n Line %d: is not a function.\n", dfg_LINENUMBER);
    misc_FinishUserErrorReport();
  }
  return term_Create(s, Arguments);
}

static __inline__ TERM dfg_AtomCreate(char* Name, LIST Arguments)
/* Look up the symbol, check its arity and create the atom term */
{
  SYMBOL s;
  s = dfg_Symbol(Name, list_Length(Arguments)); /* Frees the string */
  if (symbol_IsVariable(s) || !symbol_IsPredicate(s)) {
    misc_StartUserErrorReport();
    misc_UserErrorReport("\n Line %d: Symbol is not a predicate.\n", dfg_LINENUMBER);
    misc_FinishUserErrorReport();
  }
  return term_Create(s, Arguments);
}

static __inline__ void dfg_DeleteStringList(LIST List)
{
  list_DeleteWithElement(List, (void (*)(POINTER)) string_StringFree);
}

/**************************************************************/
/* Functions that handle symbols with unspecified arity       */
/**************************************************************/

/* The symbol list holds all symbols whose arity wasn't       */
/* specified in the symbol declaration section.               */
/* If the arity of a symbol was not specified in this section */
/* it is first set to 0. If the symbol occurs with always the */
/* same arity 'A' the arity of this symbol is set to 'A'.     */
static LIST   dfg_SYMBOLLIST;

static void dfg_SymAdd(SYMBOL);
static void dfg_SymCheck(SYMBOL, NAT);
static void dfg_SymCleanUp(void);

/**************************************************************/
/* Functions that handle variable names                       */
/**************************************************************/

/* List of quantified variables in the current input formula. */
/* This list is used to find symbols that by mistake weren't  */
/* declared in the symbol declaration section                 */
/* --> free variables                                         */
/* This is a list of lists, since each time a quantifier is   */
/* reached, a new list is added to the global list.           */
static LIST dfg_VARLIST;
static BOOL dfg_VARDECL;

static void   dfg_VarStart(void);
static void   dfg_VarStop(void);
static void   dfg_VarBacktrack(void);
static void   dfg_VarCheck(void);
static SYMBOL dfg_VarLookup(char*);

#define YYERROR_VERBOSE



/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

#ifndef YYSTYPE
#line 165 "dfgparser.y"
typedef union {
  int       number;
  char*     string;
  SYMBOL    symbol;
  SPROPERTY property;
  TERM      term;
  LIST      list;
  DFG_STATE state;
  BOOL      bool;
} yystype;
/* Line 193 of /opt/gnu//share/bison/yacc.c.  */
#line 336 "dfgparser.c"
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
#endif

#ifndef YYLTYPE
typedef struct yyltype
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
} yyltype;
# define YYLTYPE yyltype
# define YYLTYPE_IS_TRIVIAL 1
#endif

/* Copy the second part of user declarations.  */


/* Line 213 of /opt/gnu//share/bison/yacc.c.  */
#line 357 "dfgparser.c"

#if ! defined (yyoverflow) || YYERROR_VERBOSE

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's `empty if-body' warning. */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
#  if defined (__STDC__) || defined (__cplusplus)
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   define YYSIZE_T size_t
#  endif
#  define YYSTACK_ALLOC malloc
#  define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */


#if (! defined (yyoverflow) \
     && (! defined (__cplusplus) \
	 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  short yyss;
  YYSTYPE yyvs;
  };

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
      + YYSTACK_GAP_MAX)

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  register YYSIZE_T yyi;		\
	  for (yyi = 0; yyi < (Count); yyi++)	\
	    (To)[yyi] = (From)[yyi];	\
	}					\
      while (0)
#  endif
# endif

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack)					\
    do									\
      {									\
	YYSIZE_T yynewbytes;						\
	YYCOPY (&yyptr->Stack, Stack, yysize);				\
	Stack = &yyptr->Stack;						\
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;	\
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
    while (0)

#endif

#if defined (__STDC__) || defined (__cplusplus)
   typedef signed char yysigned_char;
#else
   typedef short yysigned_char;
#endif

/* YYFINAL -- State number of the termination state. */
#define YYFINAL  4
#define YYLAST   506

/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS  71
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS  100
/* YYNRULES -- Number of rules. */
#define YYNRULES  196
/* YYNRULES -- Number of states. */
#define YYNSTATES  477

/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   318

#define YYTRANSLATE(X) \
  ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)

/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
static const unsigned char yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      64,    65,     2,     2,    69,     2,    66,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,    70,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,    67,     2,    68,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     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,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63
};

#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
static const unsigned short yyprhs[] =
{
       0,     0,     3,    14,    26,    32,    38,    44,    50,    51,
      57,    58,    64,    65,    71,    73,    75,    77,    84,    85,
      95,    96,   102,   104,   108,   110,   116,   117,   123,   125,
     129,   131,   137,   138,   144,   146,   150,   151,   157,   159,
     163,   165,   171,   172,   178,   180,   184,   186,   192,   194,
     196,   197,   203,   204,   207,   209,   217,   220,   228,   229,
     230,   242,   252,   253,   255,   257,   261,   263,   267,   276,
     278,   280,   281,   284,   285,   293,   294,   297,   299,   304,
     311,   316,   317,   318,   329,   330,   332,   334,   338,   340,
     342,   344,   346,   348,   350,   352,   354,   356,   358,   360,
     362,   364,   368,   370,   375,   376,   379,   390,   391,   403,
     404,   412,   413,   415,   417,   418,   419,   430,   435,   437,
     441,   443,   448,   450,   454,   456,   458,   460,   467,   472,
     473,   481,   482,   484,   486,   495,   500,   502,   507,   509,
     513,   514,   517,   518,   528,   529,   545,   547,   551,   552,
     557,   561,   567,   568,   572,   574,   576,   578,   580,   582,
     584,   586,   588,   590,   591,   595,   603,   605,   607,   608,
     611,   612,   619,   620,   624,   625,   628,   634,   635,   645,
     647,   651,   652,   656,   661,   666,   673,   675,   679,   681,
     688,   689,   692,   694,   697,   703,   705
};

/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
      72,     0,    -1,     6,    64,   121,    65,    66,    73,    82,
     159,    20,    66,    -1,    16,    66,    74,    75,    78,    79,
      76,    77,    80,    19,    66,    -1,    36,    64,    63,    65,
      66,    -1,     4,    64,    63,    65,    66,    -1,    52,    64,
      81,    65,    66,    -1,    15,    64,    63,    65,    66,    -1,
      -1,    59,    64,    63,    65,    66,    -1,    -1,    35,    64,
      63,    65,    66,    -1,    -1,    13,    64,    63,    65,    66,
      -1,    46,    -1,    58,    -1,    57,    -1,    83,    99,   110,
     124,   143,   155,    -1,    -1,    49,    66,    84,    87,    90,
      92,    95,    19,    66,    -1,    -1,    29,    67,    85,    68,
      66,    -1,    86,    -1,    85,    69,    86,    -1,   121,    -1,
      64,   121,    69,    98,    65,    -1,    -1,    43,    67,    88,
      68,    66,    -1,    89,    -1,    88,    69,    89,    -1,   121,
      -1,    64,   121,    69,    98,    65,    -1,    -1,    51,    67,
      91,    68,    66,    -1,   121,    -1,    91,    69,   121,    -1,
      -1,    39,    67,    93,    68,    66,    -1,    94,    -1,    93,
      69,    94,    -1,   121,    -1,    64,   121,    69,    98,    65,
      -1,    -1,    45,    67,    96,    68,    66,    -1,    97,    -1,
      96,    69,    97,    -1,   121,    -1,    64,   121,    69,    98,
      65,    -1,    61,    -1,    60,    -1,    -1,    14,    66,   100,
      19,    66,    -1,    -1,   100,   101,    -1,   104,    -1,    54,
      64,   121,    69,   121,    65,    66,    -1,   136,    66,    -1,
      42,    64,   121,    69,   107,    65,    66,    -1,    -1,    -1,
      27,    64,    67,   102,   122,   103,    68,    69,   136,    65,
      66,    -1,    50,   121,   105,    30,     7,    67,   106,    68,
      66,    -1,    -1,    28,    -1,   121,    -1,   106,    69,   121,
      -1,   121,    -1,   107,    69,   121,    -1,    25,    64,   109,
      65,    66,   111,    19,    66,    -1,     5,    -1,    12,    -1,
      -1,   110,   108,    -1,    -1,   111,    26,    64,   116,   112,
      65,    66,    -1,    -1,    69,   121,    -1,   136,    -1,    37,
      64,   113,    65,    -1,   118,    64,   113,    69,   113,    65,
      -1,   119,    64,   117,    65,    -1,    -1,    -1,   120,    64,
      67,   114,   122,   115,    68,    69,   113,    65,    -1,    -1,
     113,    -1,   113,    -1,   117,    69,   113,    -1,    22,    -1,
      33,    -1,    34,    -1,     3,    -1,    40,    -1,    23,    -1,
      27,    -1,    62,    -1,    60,    -1,    47,    -1,    18,    -1,
      41,    -1,   123,    -1,   122,    69,   123,    -1,   121,    -1,
     121,    64,   121,    65,    -1,    -1,   124,   125,    -1,    10,
      64,   109,    69,    11,    65,    66,   127,    19,    66,    -1,
      -1,    10,    64,   109,    69,    17,    65,    66,   126,   137,
      19,    66,    -1,    -1,   127,     8,    64,   128,   112,    65,
      66,    -1,    -1,   129,    -1,   132,    -1,    -1,    -1,    27,
      64,    67,   130,   122,   131,    68,    69,   132,    65,    -1,
      40,    64,   133,    65,    -1,   134,    -1,   133,    69,   134,
      -1,   136,    -1,    37,    64,   136,    65,    -1,   136,    -1,
     135,    69,   136,    -1,   121,    -1,    56,    -1,    24,    -1,
      21,    64,   141,    69,   141,    65,    -1,   121,    64,   142,
      65,    -1,    -1,   137,     8,    64,   138,   112,    65,    66,
      -1,    -1,   139,    -1,   140,    -1,    23,    64,    67,   135,
      68,    69,   140,    65,    -1,     3,    64,   133,    65,    -1,
     121,    -1,   121,    64,   142,    65,    -1,   141,    -1,   142,
      69,   141,    -1,    -1,   143,   144,    -1,    -1,    44,    64,
     121,    65,    66,   145,   146,    19,    66,    -1,    -1,   146,
      53,    64,   150,    69,   154,    69,   121,    69,    67,   147,
      68,   148,    65,    66,    -1,   150,    -1,   147,    69,   150,
      -1,    -1,    69,    67,   149,    68,    -1,   150,    70,   150,
      -1,   149,    69,   150,    70,   150,    -1,    -1,   152,   151,
     153,    -1,   121,    -1,    37,    -1,    22,    -1,    33,    -1,
      34,    -1,     3,    -1,    40,    -1,    27,    -1,    23,    -1,
      -1,    64,   117,    65,    -1,    64,    67,   122,    68,    69,
     113,    65,    -1,   129,    -1,   139,    -1,    -1,   155,   156,
      -1,    -1,    55,    66,   157,   158,    19,    66,    -1,    -1,
     158,   141,    66,    -1,    -1,   159,   160,    -1,    31,    66,
     168,    19,    66,    -1,    -1,    48,    64,   121,   161,    65,
      66,   162,    19,    66,    -1,    63,    -1,    38,   163,     9,
      -1,    -1,   163,   164,    66,    -1,    41,    64,   165,    65,
      -1,    18,    64,   170,    65,    -1,    47,    64,    62,    69,
      98,    65,    -1,   166,    -1,   165,    69,   166,    -1,   121,
      -1,    64,   121,    69,    60,   167,    65,    -1,    -1,    69,
      62,    -1,   169,    -1,   168,   169,    -1,    32,    67,   170,
      68,    66,    -1,   121,    -1,   170,    69,   121,    -1
};

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const unsigned short yyrline[] =
{
       0,   206,   206,   218,   229,   233,   237,   241,   245,   246,
     250,   251,   255,   256,   260,   261,   262,   269,   281,   282,
     291,   292,   295,   296,   299,   300,   304,   305,   308,   309,
     312,   313,   316,   317,   320,   321,   324,   325,   328,   329,
     332,   333,   336,   337,   340,   341,   344,   345,   348,   349,
     356,   357,   362,   363,   366,   367,   369,   370,   372,   373,
     372,   382,   386,   387,   390,   391,   394,   395,   402,   412,
     413,   416,   417,   420,   421,   435,   436,   439,   440,   442,
     444,   446,   447,   446,   454,   455,   458,   460,   464,   465,
     466,   469,   470,   473,   474,   477,   483,   485,   487,   489,
     493,   495,   499,   510,   534,   535,   538,   548,   547,   554,
     555,   569,   570,   573,   574,   575,   574,   582,   586,   588,
     592,   593,   597,   598,   601,   603,   605,   607,   609,   616,
     617,   620,   621,   624,   625,   628,   635,   637,   641,   643,
     651,   652,   656,   655,   669,   670,   691,   693,   698,   699,
     702,   710,   721,   720,   732,   733,   734,   735,   736,   737,
     738,   739,   740,   743,   744,   745,   748,   749,   757,   758,
     761,   761,   768,   769,   776,   777,   780,   781,   781,   789,
     792,   795,   796,   799,   800,   820,   832,   833,   836,   848,
     865,   866,   883,   884,   887,   891,   892
};
#endif

#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "DFG_AND", "DFG_AUTHOR", "DFG_AXIOMS", 
  "DFG_BEGPROB", "DFG_BY", "DFG_CLAUSE", "DFG_CLOSEBRACE", "DFG_CLSLIST", 
  "DFG_CNF", "DFG_CONJECS", "DFG_DATE", "DFG_DECLLIST", "DFG_DESC", 
  "DFG_DESCLIST", "DFG_DNF", "DFG_DOMPRED", "DFG_ENDLIST", "DFG_ENDPROB", 
  "DFG_EQUAL", "DFG_EQUIV", "DFG_EXISTS", "DFG_FALSE", "DFG_FORMLIST", 
  "DFG_FORMULA", "DFG_FORALL", "DFG_FREELY", "DFG_FUNC", "DFG_GENERATED", 
  "DFG_GENSET", "DFG_HYPOTH", "DFG_IMPLIED", "DFG_IMPLIES", "DFG_LOGIC", 
  "DFG_NAME", "DFG_NOT", "DFG_OPENBRACE", "DFG_OPERAT", "DFG_OR", 
  "DFG_PREC", "DFG_PRED", "DFG_PRDICAT", "DFG_PRFLIST", "DFG_QUANTIF", 
  "DFG_SATIS", "DFG_SETFLAG", "DFG_SETTINGS", "DFG_SYMLIST", "DFG_SORT", 
  "DFG_SORTS", "DFG_STATUS", "DFG_STEP", "DFG_SUBSORT", "DFG_TERMLIST", 
  "DFG_TRUE", "DFG_UNKNOWN", "DFG_UNSATIS", "DFG_VERSION", "DFG_NUM", 
  "DFG_MINUS1", "DFG_ID", "DFG_TEXT", "'('", "')'", "'.'", "'['", "']'", 
  "','", "':'", "$accept", "problem", "description", "name", "author", 
  "status", "desctext", "versionopt", "logicopt", "dateopt", "log_state", 
  "logicalpart", "symbollistopt", "functionsopt", "functionlist", "func", 
  "predicatesopt", "predicatelist", "pred", "sortsopt", "sortlist", 
  "operatorsopt", "operatorlist", "op", "quantifiersopt", 
  "quantifierlist", "quant", "number", "declarationlistopt", 
  "decllistopt", "decl", "@1", "@2", "gendecl", "freelyopt", "funclist", 
  "sortdecl", "formulalist", "origin", "formulalistsopt", 
  "formulalistopt", "labelopt", "formula", "@3", "@4", "formulaopt", 
  "arglist", "binsymbol", "nsymbol", "quantsymbol", "id", "qtermlist", 
  "qterm", "clauselistsopt", "clauselist", "@5", "cnfclausesopt", 
  "cnfclauseopt", "cnfclause", "@6", "@7", "cnfclausebody", "litlist", 
  "lit", "atomlist", "atom", "dnfclausesopt", "dnfclauseopt", "dnfclause", 
  "dnfclausebody", "term", "termlist", "prooflistsopt", "prooflist", "@8", 
  "prooflistopt", "parentlist", "assoclistopt", "assoclist", 
  "id_or_formula", "@9", "anysymbol", "optargs", "clause", 
  "listOfTermsopt", "listOfTerms", "@10", "terms", "settinglistsopt", 
  "settinglist", "@11", "flags", "spassflags", "spassflag", "preclist", 
  "precitem", "statopt", "gsettings", "gsetting", "labellist", 0
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
static const unsigned short yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
     315,   316,   317,   318,    40,    41,    46,    91,    93,    44,
      58
};
# endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const unsigned char yyr1[] =
{
       0,    71,    72,    73,    74,    75,    76,    77,    78,    78,
      79,    79,    80,    80,    81,    81,    81,    82,    83,    83,
      84,    84,    85,    85,    86,    86,    87,    87,    88,    88,
      89,    89,    90,    90,    91,    91,    92,    92,    93,    93,
      94,    94,    95,    95,    96,    96,    97,    97,    98,    98,
      99,    99,   100,   100,   101,   101,   101,   101,   102,   103,
     101,   104,   105,   105,   106,   106,   107,   107,   108,   109,
     109,   110,   110,   111,   111,   112,   112,   113,   113,   113,
     113,   114,   115,   113,   116,   116,   117,   117,   118,   118,
     118,   119,   119,   120,   120,   121,   121,   121,   121,   121,
     122,   122,   123,   123,   124,   124,   125,   126,   125,   127,
     127,   128,   128,   129,   130,   131,   129,   132,   133,   133,
     134,   134,   135,   135,   136,   136,   136,   136,   136,   137,
     137,   138,   138,   139,   139,   140,   141,   141,   142,   142,
     143,   143,   145,   144,   146,   146,   147,   147,   148,   148,
     149,   149,   151,   150,   152,   152,   152,   152,   152,   152,
     152,   152,   152,   153,   153,   153,   154,   154,   155,   155,
     157,   156,   158,   158,   159,   159,   160,   161,   160,   162,
     162,   163,   163,   164,   164,   164,   165,   165,   166,   166,
     167,   167,   168,   168,   169,   170,   170
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
static const unsigned char yyr2[] =
{
       0,     2,    10,    11,     5,     5,     5,     5,     0,     5,
       0,     5,     0,     5,     1,     1,     1,     6,     0,     9,
       0,     5,     1,     3,     1,     5,     0,     5,     1,     3,
       1,     5,     0,     5,     1,     3,     0,     5,     1,     3,
       1,     5,     0,     5,     1,     3,     1,     5,     1,     1,
       0,     5,     0,     2,     1,     7,     2,     7,     0,     0,
      11,     9,     0,     1,     1,     3,     1,     3,     8,     1,
       1,     0,     2,     0,     7,     0,     2,     1,     4,     6,
       4,     0,     0,    10,     0,     1,     1,     3,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     3,     1,     4,     0,     2,    10,     0,    11,     0,
       7,     0,     1,     1,     0,     0,    10,     4,     1,     3,
       1,     4,     1,     3,     1,     1,     1,     6,     4,     0,
       7,     0,     1,     1,     8,     4,     1,     4,     1,     3,
       0,     2,     0,     9,     0,    15,     1,     3,     0,     4,
       3,     5,     0,     3,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     0,     3,     7,     1,     1,     0,     2,
       0,     6,     0,     3,     0,     2,     5,     0,     9,     1,
       3,     0,     3,     4,     4,     6,     1,     3,     1,     6,
       0,     2,     1,     2,     5,     1,     3
};

/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
   means the default is an error.  */
static const unsigned char yydefact[] =
{
       0,     0,     0,     0,     1,    98,    99,    97,    96,    95,
       0,     0,     0,     0,    18,     0,     0,   174,    50,     0,
       0,    20,     0,     0,    71,     0,     0,     8,     0,    26,
       0,     0,     0,   175,    52,   104,     0,     0,     0,    10,
       0,     0,    32,     2,     0,     0,     0,     0,    72,   140,
       0,     0,     0,     0,     0,     0,     0,    22,    24,     0,
       0,    36,     0,     0,   192,   177,     0,     0,   126,     0,
       0,     0,     0,   125,    53,    54,   124,     0,     0,     0,
     105,   168,     4,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    28,    30,     0,     0,    42,     0,     0,
     193,     0,    51,     0,     0,     0,    62,     0,     0,    56,
      69,    70,     0,     0,     0,   141,    17,     5,     0,     0,
       0,     0,    12,     0,    21,    23,     0,     0,     0,     0,
      34,     0,     0,     0,   195,     0,   176,     0,   136,     0,
      58,     0,    63,     0,     0,   138,     0,     0,     0,     0,
       0,   169,     9,     0,    14,    16,    15,     0,     0,     0,
       0,    49,    48,     0,     0,    27,    29,     0,     0,     0,
       0,    38,    40,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   128,     0,    73,     0,     0,   170,
      11,     0,     0,     0,     0,    25,     0,    33,    35,     0,
       0,     0,     0,     0,    44,    46,    19,   194,   196,   181,
     179,     0,     0,     0,   102,    59,   100,     0,    66,     0,
       0,   139,     0,     0,     0,     0,   172,     6,     0,     0,
       3,    31,     0,    37,    39,     0,     0,     0,     0,     0,
     137,   127,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   142,     0,     7,     0,     0,     0,    43,
      45,   180,     0,     0,     0,     0,   178,     0,   101,     0,
      57,    67,     0,    64,    55,    68,    84,   109,   107,   144,
       0,     0,    13,    41,     0,     0,     0,     0,   182,   103,
       0,     0,     0,    91,    88,    93,    94,    89,    90,     0,
      92,    85,    75,     0,     0,     0,    77,     0,   129,     0,
     171,   173,    47,     0,     0,   188,     0,   186,     0,     0,
      61,    65,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   184,     0,   183,     0,     0,     0,     0,
      76,     0,     0,    86,     0,    81,   111,   106,     0,     0,
     143,     0,     0,   187,     0,    60,    78,    74,     0,    80,
       0,     0,     0,     0,    75,   112,   113,   131,   108,   159,
     156,   162,   161,   157,   158,   155,   160,   154,     0,   152,
     190,   185,     0,    87,    82,     0,     0,     0,     0,     0,
      75,   132,   133,     0,   163,     0,     0,    79,     0,   114,
       0,     0,   118,   120,     0,     0,     0,     0,   166,   167,
       0,     0,   153,   191,   189,     0,     0,     0,   117,     0,
     110,     0,     0,     0,     0,     0,     0,     0,   115,     0,
     119,   135,     0,   122,   130,     0,     0,   164,     0,     0,
     121,     0,     0,     0,     0,    83,     0,     0,   123,     0,
       0,     0,     0,     0,   146,     0,     0,   134,   148,     0,
     165,   116,     0,     0,   147,     0,     0,     0,     0,   145,
     149,     0,     0,     0,   150,     0,   151
};

/* YYDEFGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
      -1,     2,    14,    20,    27,    87,   122,    39,    54,   160,
     157,    17,    18,    29,    56,    57,    42,    92,    93,    61,
     129,    97,   170,   171,   133,   203,   204,   163,    24,    46,
      74,   180,   244,    75,   143,   272,   217,    48,   112,    35,
     222,   324,   343,   361,   398,   302,   344,   303,   304,   305,
      76,   215,   216,    49,    80,   308,   307,   364,   365,   416,
     439,   366,   401,   402,   432,   306,   330,   390,   391,   392,
     145,   146,    81,   115,   279,   309,   453,   463,   467,   378,
     394,   379,   412,   410,   116,   151,   226,   254,    22,    33,
     101,   211,   238,   265,   316,   317,   396,    63,    64,   135
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -356
static const short yypact[] =
{
       9,   -32,    35,   232,  -356,  -356,  -356,  -356,  -356,  -356,
      -6,    13,    67,    20,    45,    53,    30,  -356,   110,    46,
     118,   121,   -12,    73,  -356,    91,    84,   113,   112,   141,
     123,   128,   132,  -356,  -356,   175,   152,   161,   155,   191,
       2,   162,   180,  -356,   204,   232,   214,   173,  -356,   252,
     176,   206,   209,   213,   226,   232,    47,  -356,  -356,    80,
     218,   254,   224,   -14,  -356,  -356,   230,   233,  -356,   234,
     241,   232,   242,  -356,  -356,  -356,   243,   237,    21,   244,
    -356,   260,  -356,   246,   245,   250,   251,   294,   247,   248,
       2,   232,    93,  -356,  -356,   232,   255,   272,   232,   253,
    -356,   256,  -356,   232,   257,   232,   290,   232,   232,  -356,
    -356,  -356,   258,    21,   261,  -356,   271,  -356,   262,   264,
      14,   263,   317,   108,  -356,  -356,   265,   266,    80,   119,
    -356,    85,   268,   312,  -356,   124,  -356,   270,   273,   269,
    -356,   274,  -356,   309,   275,  -356,   -52,   276,   277,   232,
     279,  -356,  -356,   281,  -356,  -356,  -356,   284,   287,   288,
     321,  -356,  -356,   286,   108,  -356,  -356,   289,   232,   232,
     138,  -356,  -356,   156,   291,   293,   232,   -17,   232,   232,
     232,   232,   346,   232,  -356,   232,  -356,    40,   296,  -356,
    -356,   297,   299,   302,   300,  -356,   303,  -356,  -356,   285,
     301,    85,   232,   143,  -356,  -356,  -356,  -356,  -356,  -356,
    -356,   337,    16,   304,   298,   306,  -356,    32,  -356,   311,
     305,  -356,    56,   308,   314,   310,  -356,  -356,   315,   318,
    -356,  -356,   108,  -356,  -356,   313,   319,   156,    -2,   320,
    -356,  -356,   232,   232,   316,   322,   232,   232,   323,   324,
     307,   325,   326,  -356,   240,  -356,   327,   329,   108,  -356,
    -356,  -356,   331,   332,   334,   333,  -356,   335,  -356,   336,
    -356,  -356,   145,  -356,  -356,  -356,    96,  -356,  -356,  -356,
     338,   340,  -356,  -356,   342,   232,   163,   339,  -356,  -356,
     239,   343,   232,  -356,  -356,  -356,  -356,  -356,  -356,   344,
    -356,  -356,   341,   347,   348,   350,  -356,     3,  -356,   -15,
    -356,  -356,  -356,    42,   232,  -356,    43,  -356,   349,   351,
    -356,  -356,    96,   232,   352,    96,    96,   353,   355,   357,
      57,   358,   361,  -356,   359,  -356,   163,   108,   360,   362,
    -356,   363,   364,  -356,    44,  -356,   -13,  -356,   366,   365,
    -356,   168,   372,  -356,   369,  -356,  -356,  -356,    96,  -356,
      96,   232,   371,   373,   341,  -356,  -356,     0,  -356,  -356,
    -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,   367,  -356,
     370,  -356,   375,  -356,   306,   374,   228,   377,   379,   380,
     341,  -356,  -356,    50,   381,   376,   382,  -356,   383,  -356,
     384,    66,  -356,  -356,   386,   228,   387,   385,  -356,  -356,
     388,     7,  -356,  -356,  -356,   389,   232,   239,  -356,   228,
    -356,    69,   239,   393,   232,   232,    90,    96,   306,   390,
    -356,  -356,   153,  -356,  -356,   391,   179,  -356,   396,   395,
    -356,   397,   239,   398,   401,  -356,   402,   399,  -356,   168,
      96,   409,   408,   185,  -356,   410,   411,  -356,   405,   168,
    -356,  -356,   400,   412,  -356,   168,   413,   198,   345,  -356,
    -356,   168,   168,   394,  -356,   168,  -356
};

/* YYPGOTO[NTERM-NUM].  */
static const short yypgoto[] =
{
    -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,
    -356,  -356,  -356,  -356,  -356,   392,  -356,  -356,   259,  -356,
    -356,  -356,  -356,   202,  -356,  -356,   216,  -152,  -356,  -356,
    -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,   267,  -356,
    -356,  -340,  -267,  -356,  -356,  -356,    70,  -356,  -356,  -356,
      -3,  -355,   235,  -356,  -356,  -356,  -356,  -356,    87,  -356,
    -356,    33,    78,    68,  -356,   -45,  -356,  -356,    92,    39,
    -101,   328,  -356,  -356,  -356,  -356,  -356,  -356,  -356,  -308,
    -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,
    -356,  -356,  -356,  -356,  -356,   154,  -356,  -356,   425,   207
};

/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule which
   number is the opposite.  If zero, do what YYDEFACT says.
   If YYTABLE_NINF, parse error.  */
#define YYTABLE_NINF -1
static const unsigned short yytable[] =
{
      10,    77,   139,   388,   331,    99,   384,   261,    30,   301,
     293,   328,   196,   184,   362,     1,   262,   185,    62,    31,
       5,   209,   329,   389,   387,     5,   110,   363,    67,   294,
     295,    68,     3,   111,   296,     4,    32,    58,   332,   263,
     297,   298,    65,     6,   299,   264,   210,   300,     6,     7,
     407,   223,    88,   388,     7,   339,    94,   224,   342,    11,
     154,   428,     8,    73,     9,   348,    55,     8,   106,     9,
     436,   155,   156,   389,   425,   249,   349,   362,   213,    12,
     257,   240,   250,    13,   221,   185,    15,    58,   126,    19,
     363,   382,   130,   383,    16,   134,    21,   245,     5,   293,
     138,   246,   141,     5,   144,   138,   284,   333,   335,   359,
      25,   176,   336,   360,     5,    89,    90,    67,   294,   295,
      68,     6,    26,   296,    23,    94,     6,     7,   172,   297,
     298,   418,     7,   299,   431,   419,   300,     6,   419,    34,
       8,   454,     9,     7,    91,     8,   188,     9,    37,   169,
      28,   464,    73,   281,    36,   437,     8,   468,     9,   360,
     438,   127,   128,   473,   474,   198,   199,   476,   161,   162,
     205,   369,    38,   208,     5,   138,   138,   214,   218,    40,
     220,     5,   138,   455,    41,   354,     5,   167,   168,    43,
     370,   371,   175,   176,    44,   372,    45,     6,   172,   235,
      47,   373,   374,     7,     6,   375,   200,   201,   376,     6,
       7,   236,   237,   291,   292,     7,     8,    50,     9,    52,
     202,   441,   442,     8,    51,     9,    53,   314,     8,    59,
       9,    60,     5,    66,   205,    67,    62,    78,    68,   267,
     214,    69,    82,   271,   273,   319,     5,   444,   243,    67,
       5,   138,    68,   458,   459,     6,    70,     5,     5,   280,
      67,     7,    79,    68,    71,   400,   470,   471,    72,     6,
      73,    83,    84,     6,     8,     7,     9,    85,    86,     7,
       6,     6,   134,   315,    73,    95,     7,     7,     8,   321,
       9,    98,     8,    96,     9,    73,   102,   103,   104,     8,
       8,     9,     9,   109,   114,   105,   107,   108,   113,   121,
     118,   334,   117,   119,   124,   120,   123,   132,   142,   136,
     340,   137,   131,   147,   140,   149,   150,   158,   152,   153,
     159,   174,   165,   315,   164,   173,   177,   178,   179,   182,
     194,   403,   186,   181,   183,   189,   187,   190,   377,   191,
     192,   195,   193,   219,   232,   197,   239,   206,   214,   207,
     403,   225,   242,   227,   228,   229,   230,   233,   231,   241,
     248,   276,   429,   251,   403,   243,   253,   433,   247,   252,
     148,   255,   258,   256,   269,   259,   266,   166,   270,   274,
     275,   277,   278,   282,   283,   285,   286,   448,   287,   288,
     289,   318,   388,   234,   310,   290,   311,   312,   322,   320,
     323,   325,   326,   214,   327,   472,   338,   341,   337,   346,
     345,   435,   214,   347,   350,   351,   355,   356,   352,   357,
     367,   368,   380,   358,   381,   385,   393,   386,   413,   395,
     397,   399,   404,   405,   406,   411,   377,   414,   417,   363,
     423,   415,   420,   260,   422,   440,   377,   424,   427,   434,
     443,   445,   377,   446,   475,   449,   447,   465,   377,   377,
     450,   451,   377,   457,   462,   460,   461,   466,   268,   469,
     408,   426,   125,   421,   456,   409,   452,   430,   100,     0,
     353,     0,   313,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   212
};

static const short yycheck[] =
{
       3,    46,   103,     3,    19,    19,   361,     9,    20,   276,
       3,     8,   164,    65,    27,     6,    18,    69,    32,    31,
      18,    38,    19,    23,   364,    18,     5,    40,    21,    22,
      23,    24,    64,    12,    27,     0,    48,    40,    53,    41,
      33,    34,    45,    41,    37,    47,    63,    40,    41,    47,
     390,    11,    55,     3,    47,   322,    59,    17,   325,    65,
      46,   416,    60,    56,    62,     8,    64,    60,    71,    62,
     425,    57,    58,    23,    67,    19,    19,    27,   179,    66,
     232,    65,    26,    16,   185,    69,    66,    90,    91,    36,
      40,   358,    95,   360,    49,    98,    66,    65,    18,     3,
     103,    69,   105,    18,   107,   108,   258,    65,    65,    65,
      64,    69,    69,    69,    18,    68,    69,    21,    22,    23,
      24,    41,     4,    27,    14,   128,    41,    47,   131,    33,
      34,    65,    47,    37,    65,    69,    40,    41,    69,    66,
      60,   449,    62,    47,    64,    60,   149,    62,    64,    64,
      29,   459,    56,   254,    63,    65,    60,   465,    62,    69,
     427,    68,    69,   471,   472,   168,   169,   475,    60,    61,
     173,     3,    59,   176,    18,   178,   179,   180,   181,    67,
     183,    18,   185,   450,    43,   337,    18,    68,    69,    66,
      22,    23,    68,    69,    66,    27,    64,    41,   201,   202,
      25,    33,    34,    47,    41,    37,    68,    69,    40,    41,
      47,    68,    69,    68,    69,    47,    60,    65,    62,    64,
      64,    68,    69,    60,    63,    62,    35,    64,    60,    67,
      62,    51,    18,    19,   237,    21,    32,    64,    24,   242,
     243,    27,    66,   246,   247,   290,    18,    68,    69,    21,
      18,   254,    24,    68,    69,    41,    42,    18,    18,    19,
      21,    47,    10,    24,    50,    37,    68,    69,    54,    41,
      56,    65,    63,    41,    60,    47,    62,    64,    52,    47,
      41,    41,   285,   286,    56,    67,    47,    47,    60,   292,
      62,    67,    60,    39,    62,    56,    66,    64,    64,    60,
      60,    62,    62,    66,    44,    64,    64,    64,    64,    15,
      65,   314,    66,    63,    66,    64,    69,    45,    28,    66,
     323,    65,    67,    65,    67,    64,    55,    64,    66,    65,
      13,    19,    66,   336,    69,    67,    66,    64,    69,    30,
      19,   386,    66,    69,    69,    66,    69,    66,   351,    65,
      63,    65,    64,     7,    69,    66,    19,    66,   361,    66,
     405,    65,    64,    66,    65,    63,    66,    66,    65,    65,
      65,    64,   417,    65,   419,    69,    66,   422,    67,    65,
     113,    66,    69,    65,    68,    66,    66,   128,    66,    66,
      66,    66,    66,    66,    65,    64,    64,   442,    64,    66,
      65,    62,     3,   201,    66,    69,    66,    65,    64,    66,
      69,    64,    64,   416,    64,    70,    65,    65,    69,    64,
      67,   424,   425,    66,    66,    64,    66,    65,    69,    66,
      64,    66,    60,    69,    65,    64,    69,    64,    62,    69,
      65,    67,    65,    64,    64,    64,   449,    65,    64,    40,
      65,    68,    66,   237,    67,    65,   459,    69,    69,    66,
      69,    65,   465,    68,    70,    67,    69,    67,   471,   472,
      69,    69,   475,    65,    69,    65,    65,    65,   243,    66,
     393,   411,    90,   405,   451,   393,   447,   419,    63,    -1,
     336,    -1,   285,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   178
};

/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   symbol of state STATE-NUM.  */
static const unsigned char yystos[] =
{
       0,     6,    72,    64,     0,    18,    41,    47,    60,    62,
     121,    65,    66,    16,    73,    66,    49,    82,    83,    36,
      74,    66,   159,    14,    99,    64,     4,    75,    29,    84,
      20,    31,    48,   160,    66,   110,    63,    64,    59,    78,
      67,    43,    87,    66,    66,    64,   100,    25,   108,   124,
      65,    63,    64,    35,    79,    64,    85,    86,   121,    67,
      51,    90,    32,   168,   169,   121,    19,    21,    24,    27,
      42,    50,    54,    56,   101,   104,   121,   136,    64,    10,
     125,   143,    66,    65,    63,    64,    52,    76,   121,    68,
      69,    64,    88,    89,   121,    67,    39,    92,    67,    19,
     169,   161,    66,    64,    64,    64,   121,    64,    64,    66,
       5,    12,   109,    64,    44,   144,   155,    66,    65,    63,
      64,    15,    77,    69,    66,    86,   121,    68,    69,    91,
     121,    67,    45,    95,   121,   170,    66,    65,   121,   141,
      67,   121,    28,   105,   121,   141,   142,    65,   109,    64,
      55,   156,    66,    65,    46,    57,    58,    81,    64,    13,
      80,    60,    61,    98,    69,    66,    89,    68,    69,    64,
      93,    94,   121,    67,    19,    68,    69,    66,    64,    69,
     102,    69,    30,    69,    65,    69,    66,    69,   121,    66,
      66,    65,    63,    64,    19,    65,    98,    66,   121,   121,
      68,    69,    64,    96,    97,   121,    66,    66,   121,    38,
      63,   162,   142,   141,   121,   122,   123,   107,   121,     7,
     121,   141,   111,    11,    17,    65,   157,    66,    65,    63,
      66,    65,    69,    66,    94,   121,    68,    69,   163,    19,
      65,    65,    64,    69,   103,    65,    69,    67,    65,    19,
      26,    65,    65,    66,   158,    66,    65,    98,    69,    66,
      97,     9,    18,    41,    47,   164,    66,   121,   123,    68,
      66,   121,   106,   121,    66,    66,    64,    66,    66,   145,
      19,   141,    66,    65,    98,    64,    64,    64,    66,    65,
      69,    68,    69,     3,    22,    23,    27,    33,    34,    37,
      40,   113,   116,   118,   119,   120,   136,   127,   126,   146,
      66,    66,    65,   170,    64,   121,   165,   166,    62,   136,
      66,   121,    64,    69,   112,    64,    64,    64,     8,    19,
     137,    19,    53,    65,   121,    65,    69,    69,    65,   113,
     121,    65,   113,   113,   117,    67,    64,    66,     8,    19,
      66,    64,    69,   166,    98,    66,    65,    66,    69,    65,
      69,   114,    27,    40,   128,   129,   132,    64,    66,     3,
      22,    23,    27,    33,    34,    37,    40,   121,   150,   152,
      60,    65,   113,   113,   122,    64,    64,   112,     3,    23,
     138,   139,   140,    69,   151,    69,   167,    65,   115,    67,
      37,   133,   134,   136,    65,    64,    64,   112,   129,   139,
     154,    64,   153,    62,    65,    68,   130,    64,    65,    69,
      66,   133,    67,    65,    69,    67,   117,    69,   122,   136,
     134,    65,   135,   136,    66,   121,   122,    65,   113,   131,
      65,    68,    69,    69,    68,    65,    68,    69,   136,    67,
      69,    69,   140,   147,   150,   113,   132,    65,    68,    69,
      65,    65,    69,   148,   150,    67,    65,   149,   150,    66,
      68,    69,    70,   150,   150,    70,   150
};

#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0

#define YYACCEPT	goto yyacceptlab
#define YYABORT		goto yyabortlab
#define YYERROR		goto yyerrlab1

/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */

#define YYFAIL		goto yyerrlab

#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)					\
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    {								\
      yychar = (Token);						\
      yylval = (Value);						\
      yychar1 = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { 								\
      yyerror ("syntax error: cannot back up");			\
      YYERROR;							\
    }								\
while (0)

#define YYTERROR	1
#define YYERRCODE	256

/* YYLLOC_DEFAULT -- Compute the default location (before the actions
   are run).  */

#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)           \
  Current.first_line   = Rhs[1].first_line;      \
  Current.first_column = Rhs[1].first_column;    \
  Current.last_line    = Rhs[N].last_line;       \
  Current.last_column  = Rhs[N].last_column;
#endif

/* YYLEX -- calling `yylex' with the right arguments.  */

#define YYLEX	yylex ()

/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)			\
do {						\
  if (yydebug)					\
    YYFPRINTF Args;				\
} while (0)
# define YYDSYMPRINT(Args)			\
do {						\
  if (yydebug)					\
    yysymprint Args;				\
} while (0)
/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YYDSYMPRINT(Args)
#endif /* !YYDEBUG */

/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef	YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#if YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif



#if YYERROR_VERBOSE

# ifndef yystrlen
#  if defined (__GLIBC__) && defined (_STRING_H)
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
static YYSIZE_T
#   if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
#   else
yystrlen (yystr)
     const char *yystr;
#   endif
{
  register const char *yys = yystr;

  while (*yys++ != '\0')
    continue;

  return yys - yystr - 1;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
static char *
#   if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
#   else
yystpcpy (yydest, yysrc)
     char *yydest;
     const char *yysrc;
#   endif
{
  register char *yyd = yydest;
  register const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif

#endif /* !YYERROR_VERBOSE */



#if YYDEBUG
/*-----------------------------.
| Print this symbol on YYOUT.  |
`-----------------------------*/

static void
#if defined (__STDC__) || defined (__cplusplus)
yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
#else
yysymprint (yyout, yytype, yyvalue)
    FILE* yyout;
    int yytype;
    YYSTYPE yyvalue;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  (void) yyvalue;

  if (yytype < YYNTOKENS)
    {
      YYFPRINTF (yyout, "token %s (", yytname[yytype]);
# ifdef YYPRINT
      YYPRINT (yyout, yytoknum[yytype], yyvalue);
# endif
    }
  else
    YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);

  switch (yytype)
    {
      default:
        break;
    }
  YYFPRINTF (yyout, ")");
}
#endif /* YYDEBUG. */


/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
#if defined (__STDC__) || defined (__cplusplus)
yydestruct (int yytype, YYSTYPE yyvalue)
#else
yydestruct (yytype, yyvalue)
    int yytype;
    YYSTYPE yyvalue;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  /*(void) yyvalue;*/

  switch (yytype)
    {
      default:
        break;
    }
}



/* The user can define YYPARSE_PARAM as the name of an argument to be passed
   into yyparse.  The argument should have type void *.
   It should actually point to an object.
   Grammar actions can access the variable by casting it
   to the proper pointer type.  */

#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL
# else
#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
# endif
#else /* !YYPARSE_PARAM */
# define YYPARSE_PARAM_ARG
# define YYPARSE_PARAM_DECL
#endif /* !YYPARSE_PARAM */

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
# ifdef YYPARSE_PARAM
int yyparse (void *);
# else
int yyparse (void);
# endif
#endif


/* The lookahead symbol.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;

/* Number of parse errors so far.  */
int yynerrs;


int
yyparse (YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
{
  
  register int yystate;
  register int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Lookahead token as an internal (translated) token number.  */
  int yychar1 = 0;

  /* Three stacks and their tools:
     `yyss': related to states,
     `yyvs': related to semantic values,
     `yyls': related to locations.

     Refer to the stacks thru separate pointers, to allow yyoverflow
     to reallocate them elsewhere.  */

  /* The state stack.  */
  short	yyssa[YYINITDEPTH];
  short *yyss = yyssa;
  register short *yyssp;

  /* The semantic value stack.  */
  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  register YYSTYPE *yyvsp;



#define YYPOPSTACK   (yyvsp--, yyssp--)

  YYSIZE_T yystacksize = YYINITDEPTH;

  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;


  /* When reducing, the number of symbols on the RHS of the reduced
     rule.  */
  int yylen;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss;
  yyvsp = yyvs;

  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed. so pushing a state here evens the stacks.
     */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
	/* Give user a chance to reallocate the stack. Use copies of
	   these so that the &'s don't force the real ones into
	   memory.  */
	YYSTYPE *yyvs1 = yyvs;
	short *yyss1 = yyss;


	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  This used to be a
	   conditional around just the two extra args, but that might
	   be undefined if yyoverflow is a macro.  */
	yyoverflow ("parser stack overflow",
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),

		    &yystacksize);

	yyss = yyss1;
	yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyoverflowlab;
# else
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	goto yyoverflowlab;
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;

      {
	short *yyss1 = yyss;
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
	  goto yyoverflowlab;
	YYSTACK_RELOCATE (yyss);
	YYSTACK_RELOCATE (yyvs);

#  undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;


      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
		  (unsigned long int) yystacksize));

      if (yyssp >= yyss + yystacksize - 1)
	YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  goto yybackup;

/*-----------.
| yybackup.  |
`-----------*/
yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYPACT_NINF)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with.  */

  if (yychar <= 0)		/* This means end of input.  */
    {
      yychar1 = 0;
      yychar = YYEOF;		/* Don't call YYLEX any more.  */

      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yychar1 = YYTRANSLATE (yychar);

      /* We have to keep this `#if YYDEBUG', since we use variables
	 which are defined only if `YYDEBUG' is set.  */
      YYDPRINTF ((stderr, "Next token is "));
      YYDSYMPRINT ((stderr, yychar1, yylval));
      YYDPRINTF ((stderr, "\n"));
    }

  /* If the proper action on seeing token YYCHAR1 is to reduce or to
     detect an error, take that action.  */
  yyn += yychar1;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == YYTABLE_NINF)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */
  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
	      yychar, yytname[yychar1]));

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;


  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  yystate = yyn;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];



#if YYDEBUG
  /* We have to keep this `#if YYDEBUG', since we use variables which
     are defined only if `YYDEBUG' is set.  */
  if (yydebug)
    {
      int yyi;

      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
		 yyn - 1, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
	YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif
  switch (yyn)
    {
        case 2:
#line 210 "dfgparser.y"
    { string_StringFree(yyvsp[-7].string);
					  YYACCEPT; /* Stop immediately */ }
    break;

  case 4:
#line 230 "dfgparser.y"
    { dfg_DESC.name = yyvsp[-2].string; }
    break;

  case 5:
#line 234 "dfgparser.y"
    { dfg_DESC.author = yyvsp[-2].string; }
    break;

  case 6:
#line 238 "dfgparser.y"
    { dfg_DESC.status = yyvsp[-2].state; }
    break;

  case 7:
#line 242 "dfgparser.y"
    { dfg_DESC.description = yyvsp[-2].string; }
    break;

  case 9:
#line 247 "dfgparser.y"
    { dfg_DESC.version = yyvsp[-2].string; }
    break;

  case 11:
#line 252 "dfgparser.y"
    { dfg_DESC.logic = yyvsp[-2].string; }
    break;

  case 13:
#line 257 "dfgparser.y"
    { dfg_DESC.date = yyvsp[-2].string; }
    break;

  case 14:
#line 260 "dfgparser.y"
    { yyval.state = DFG_SATISFIABLE; }
    break;

  case 15:
#line 261 "dfgparser.y"
    { yyval.state = DFG_UNSATISFIABLE; }
    break;

  case 16:
#line 262 "dfgparser.y"
    { yyval.state = DFG_UNKNOWNSTATE; }
    break;

  case 24:
#line 299 "dfgparser.y"
    { dfg_SymbolDecl(DFG_FUNC, yyvsp[0].string, -2); }
    break;

  case 25:
#line 301 "dfgparser.y"
    { dfg_SymbolDecl(DFG_FUNC, yyvsp[-3].string, yyvsp[-1].number); }
    break;

  case 30:
#line 312 "dfgparser.y"
    { dfg_SymbolDecl(DFG_PRDICAT, yyvsp[0].string, -2); }
    break;

  case 31:
#line 313 "dfgparser.y"
    { dfg_SymbolDecl(DFG_PRDICAT, yyvsp[-3].string, yyvsp[-1].number); }
    break;

  case 34:
#line 320 "dfgparser.y"
    { dfg_SymbolDecl(DFG_PRDICAT, yyvsp[0].string, 1); }
    break;

  case 35:
#line 321 "dfgparser.y"
    { dfg_SymbolDecl(DFG_PRDICAT, yyvsp[0].string, 1); }
    break;

  case 40:
#line 332 "dfgparser.y"
    { dfg_SymbolDecl(DFG_OPERAT, yyvsp[0].string, -2); }
    break;

  case 41:
#line 333 "dfgparser.y"
    { dfg_SymbolDecl(DFG_OPERAT, yyvsp[-3].string, yyvsp[-1].number); }
    break;

  case 46:
#line 344 "dfgparser.y"
    { dfg_SymbolDecl(DFG_QUANTIF, yyvsp[0].string, -2); }
    break;

  case 47:
#line 345 "dfgparser.y"
    { dfg_SymbolDecl(DFG_QUANTIF, yyvsp[-3].string, yyvsp[-1].number); }
    break;

  case 48:
#line 348 "dfgparser.y"
    { yyval.number = -1; }
    break;

  case 49:
#line 349 "dfgparser.y"
    { yyval.number = yyvsp[0].number; }
    break;

  case 55:
#line 368 "dfgparser.y"
    { dfg_SubSort(yyvsp[-4].string,yyvsp[-2].string); }
    break;

  case 56:
#line 369 "dfgparser.y"
    { dfg_SORTDECLLIST = list_Nconc(dfg_SORTDECLLIST,list_List(list_PairCreate(NULL,yyvsp[-1].term))); }
    break;

  case 57:
#line 371 "dfgparser.y"
    { string_StringFree(yyvsp[-4].string); }
    break;

  case 58:
#line 372 "dfgparser.y"
    { dfg_VarStart(); }
    break;

  case 59:
#line 373 "dfgparser.y"
    { dfg_VarStop();  }
    break;

  case 60:
#line 374 "dfgparser.y"
    { TERM term;
					  dfg_VarBacktrack();
					  dfg_VarCheck();
					  term = dfg_CreateQuantifier(fol_All(),yyvsp[-6].list,yyvsp[-2].term);
					  dfg_SORTDECLLIST = list_Nconc(dfg_SORTDECLLIST,list_List(list_PairCreate(NULL,term)));
					}
    break;

  case 61:
#line 383 "dfgparser.y"
    { dfg_SymbolGenerated(dfg_Symbol(yyvsp[-7].string,1), yyvsp[-6].bool, yyvsp[-2].list); }
    break;

  case 62:
#line 386 "dfgparser.y"
    { yyval.bool = FALSE; }
    break;

  case 63:
#line 387 "dfgparser.y"
    { yyval.bool = TRUE; }
    break;

  case 64:
#line 390 "dfgparser.y"
    { yyval.list = list_List(yyvsp[0].string); }
    break;

  case 65:
#line 391 "dfgparser.y"
    { yyval.list = list_Cons(yyvsp[0].string, yyvsp[-2].list); }
    break;

  case 66:
#line 394 "dfgparser.y"
    { string_StringFree(yyvsp[0].string); }
    break;

  case 67:
#line 395 "dfgparser.y"
    { string_StringFree(yyvsp[0].string); }
    break;

  case 68:
#line 404 "dfgparser.y"
    { list_NReverse(yyvsp[-2].list);
                                  if (yyvsp[-5].bool) /* Axioms */
				    dfg_AXIOMLIST = list_Nconc(dfg_AXIOMLIST, yyvsp[-2].list);
				  else
				    dfg_CONJECLIST = list_Nconc(dfg_CONJECLIST, yyvsp[-2].list);
				}
    break;

  case 69:
#line 412 "dfgparser.y"
    { yyval.bool = TRUE;  }
    break;

  case 70:
#line 413 "dfgparser.y"
    { yyval.bool = FALSE; }
    break;

  case 73:
#line 420 "dfgparser.y"
    { yyval.list = list_Nil(); }
    break;

  case 74:
#line 422 "dfgparser.y"
    { LIST pair;
					  if (yyvsp[-3].term == NULL) { /* No term */
					    if (yyvsp[-2].string != NULL)
					      string_StringFree(yyvsp[-2].string);
					    yyval.list = yyvsp[-6].list;
					  } else {
					    pair = list_PairCreate(yyvsp[-2].string, yyvsp[-3].term);
					    yyval.list = list_Cons(pair, yyvsp[-6].list);
					  }
					  dfg_VarCheck();
					}
    break;

  case 75:
#line 435 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 76:
#line 436 "dfgparser.y"
    { yyval.string = yyvsp[0].string;   }
    break;

  case 77:
#line 439 "dfgparser.y"
    { yyval.term = yyvsp[0].term; }
    break;

  case 78:
#line 441 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : term_Create(fol_Not(),list_List(yyvsp[-1].term)); }
    break;

  case 79:
#line 443 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : term_Create(yyvsp[-5].symbol, list_Cons(yyvsp[-3].term, list_List(yyvsp[-1].term))); }
    break;

  case 80:
#line 445 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : term_Create(yyvsp[-3].symbol, yyvsp[-1].list); }
    break;

  case 81:
#line 446 "dfgparser.y"
    { dfg_VarStart(); }
    break;

  case 82:
#line 447 "dfgparser.y"
    { dfg_VarStop(); }
    break;

  case 83:
#line 449 "dfgparser.y"
    { dfg_VarBacktrack();
		    yyval.term = dfg_IGNORE ? NULL : dfg_CreateQuantifier(yyvsp[-9].symbol,yyvsp[-5].list,yyvsp[-1].term);
		  }
    break;

  case 84:
#line 454 "dfgparser.y"
    { yyval.term = NULL; }
    break;

  case 85:
#line 455 "dfgparser.y"
    { yyval.term = yyvsp[0].term; }
    break;

  case 86:
#line 459 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? list_Nil() : list_List(yyvsp[0].term); }
    break;

  case 87:
#line 461 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? yyvsp[-2].list : list_Nconc(yyvsp[-2].list, list_List(yyvsp[0].term)); }
    break;

  case 88:
#line 464 "dfgparser.y"
    { yyval.symbol = fol_Equiv();    }
    break;

  case 89:
#line 465 "dfgparser.y"
    { yyval.symbol = fol_Implied();  }
    break;

  case 90:
#line 466 "dfgparser.y"
    { yyval.symbol = fol_Implies();  }
    break;

  case 91:
#line 469 "dfgparser.y"
    { yyval.symbol = fol_And(); }
    break;

  case 92:
#line 470 "dfgparser.y"
    { yyval.symbol = fol_Or();  }
    break;

  case 93:
#line 473 "dfgparser.y"
    { yyval.symbol = fol_Exist(); }
    break;

  case 94:
#line 474 "dfgparser.y"
    { yyval.symbol = fol_All(); }
    break;

  case 95:
#line 477 "dfgparser.y"
    { if (dfg_IGNORE) {
  					    string_StringFree(yyvsp[0].string);
					    yyval.string = NULL;
					  } else
					    yyval.string = yyvsp[0].string;
					}
    break;

  case 96:
#line 484 "dfgparser.y"
    { yyval.string = dfg_IGNORE ? NULL : string_IntToString(yyvsp[0].number); }
    break;

  case 97:
#line 486 "dfgparser.y"
    { yyval.string = dfg_IGNORE ? NULL : string_StringCopy("set_flag"); }
    break;

  case 98:
#line 488 "dfgparser.y"
    { yyval.string = dfg_IGNORE ? NULL : string_StringCopy("set_DomPred"); }
    break;

  case 99:
#line 490 "dfgparser.y"
    { yyval.string = dfg_IGNORE ? NULL : string_StringCopy("set_precedence"); }
    break;

  case 100:
#line 494 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? list_Nil() : list_List(yyvsp[0].term); }
    break;

  case 101:
#line 496 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? yyvsp[-2].list : list_Nconc(yyvsp[-2].list, list_List(yyvsp[0].term)); }
    break;

  case 102:
#line 500 "dfgparser.y"
    { if (!dfg_IGNORE) {
		      SYMBOL s = dfg_Symbol(yyvsp[0].string,0);
		      if (!symbol_IsVariable(s)) {
			misc_StartUserErrorReport();
			misc_UserErrorReport("\n Line %d: Symbol is not a variable.\n",dfg_LINENUMBER);
			misc_FinishUserErrorReport();
		      }
		      yyval.term = term_Create(s, list_Nil());
		    }
		  }
    break;

  case 103:
#line 511 "dfgparser.y"
    { if (!dfg_IGNORE) {
		      SYMBOL p, v;
		      p = dfg_Symbol(yyvsp[-3].string, 1);
		      if (!symbol_IsPredicate(p)) {
			misc_StartUserErrorReport();
			misc_UserErrorReport("\n Line %d: Symbol is not a predicate.\n",dfg_LINENUMBER);
			misc_FinishUserErrorReport();
		      }
		      v = dfg_Symbol(yyvsp[-1].string, 0);
		      if (!symbol_IsVariable(v)) {
			misc_StartUserErrorReport();
			misc_UserErrorReport("\n Line %d: Symbol is not a variable.\n",dfg_LINENUMBER);
			misc_FinishUserErrorReport();
		      }
		      yyval.term = term_Create(p, list_List(term_Create(v,list_Nil())));
		    }
		  }
    break;

  case 106:
#line 541 "dfgparser.y"
    { list_NReverse(yyvsp[-2].list);
                    if (yyvsp[-7].bool) /* Axioms */
		      dfg_AXCLAUSES = list_Nconc(dfg_AXCLAUSES, yyvsp[-2].list);
		    else
		      dfg_CONCLAUSES = list_Nconc(dfg_CONCLAUSES, yyvsp[-2].list);
		  }
    break;

  case 107:
#line 548 "dfgparser.y"
    { stack_Push((POINTER)dfg_IGNORE); dfg_IGNORE = TRUE; }
    break;

  case 108:
#line 551 "dfgparser.y"
    { dfg_IGNORE = (BOOL)stack_PopResult(); }
    break;

  case 109:
#line 554 "dfgparser.y"
    { yyval.list = list_Nil(); }
    break;

  case 110:
#line 556 "dfgparser.y"
    { LIST pair;
		    if (yyvsp[-3].term == NULL) { /* No clause */
		      if (yyvsp[-2].string != NULL)
			string_StringFree(yyvsp[-2].string);
		      yyval.list = yyvsp[-6].list;
		    } else {
		      pair = list_PairCreate(yyvsp[-2].string, yyvsp[-3].term);
		      yyval.list = list_Cons(pair, yyvsp[-6].list);
		    }
		    dfg_VarCheck();
		  }
    break;

  case 111:
#line 569 "dfgparser.y"
    { yyval.term = NULL; }
    break;

  case 112:
#line 570 "dfgparser.y"
    { yyval.term = yyvsp[0].term; }
    break;

  case 113:
#line 573 "dfgparser.y"
    { yyval.term = yyvsp[0].term; }
    break;

  case 114:
#line 574 "dfgparser.y"
    { dfg_VarStart(); }
    break;

  case 115:
#line 575 "dfgparser.y"
    { dfg_VarStop();  }
    break;

  case 116:
#line 577 "dfgparser.y"
    { dfg_VarBacktrack();
		    yyval.term = dfg_IGNORE ? NULL : dfg_CreateQuantifier(fol_All(),yyvsp[-5].list,yyvsp[-1].term);
		  }
    break;

  case 117:
#line 583 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : term_Create(fol_Or(), yyvsp[-1].list); }
    break;

  case 118:
#line 587 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? list_Nil() : list_List(yyvsp[0].term); }
    break;

  case 119:
#line 589 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? yyvsp[-2].list : list_Nconc(yyvsp[-2].list, list_List(yyvsp[0].term)); }
    break;

  case 120:
#line 592 "dfgparser.y"
    { yyval.term = yyvsp[0].term; }
    break;

  case 121:
#line 594 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? yyvsp[-1].term : term_Create(fol_Not(),list_List(yyvsp[-1].term)); }
    break;

  case 122:
#line 597 "dfgparser.y"
    { yyval.list = list_List(yyvsp[0].term); }
    break;

  case 123:
#line 598 "dfgparser.y"
    { yyval.list = list_Nconc(yyvsp[-2].list, list_List(yyvsp[0].term)); }
    break;

  case 124:
#line 602 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : dfg_AtomCreate(yyvsp[0].string,list_Nil()); }
    break;

  case 125:
#line 604 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : term_Create(fol_True(),list_Nil()); }
    break;

  case 126:
#line 606 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : term_Create(fol_False(),list_Nil()); }
    break;

  case 127:
#line 608 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : term_Create(fol_Equality(),list_Cons(yyvsp[-3].term,list_List(yyvsp[-1].term))); }
    break;

  case 128:
#line 610 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : dfg_AtomCreate(yyvsp[-3].string, yyvsp[-1].list); }
    break;

  case 136:
#line 636 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : dfg_TermCreate(yyvsp[0].string,list_Nil()); }
    break;

  case 137:
#line 638 "dfgparser.y"
    { yyval.term = dfg_IGNORE ? NULL : dfg_TermCreate(yyvsp[-3].string, yyvsp[-1].list); }
    break;

  case 138:
#line 642 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? list_Nil() : list_List(yyvsp[0].term); }
    break;

  case 139:
#line 644 "dfgparser.y"
    { yyval.list = dfg_IGNORE ? yyvsp[-2].list : list_Nconc(yyvsp[-2].list,list_List(yyvsp[0].term)); }
    break;

  case 142:
#line 656 "dfgparser.y"
    { if (!string_Equal(yyvsp[-2].string,"SPASS")) {
		      stack_Push((POINTER)dfg_IGNORE);
		      dfg_IGNORE = TRUE;
		    }
		  }
    break;

  case 143:
#line 663 "dfgparser.y"
    { if (!string_Equal(yyvsp[-6].string,"SPASS"))
		      dfg_IGNORE = (BOOL)stack_PopResult();
		    string_StringFree(yyvsp[-6].string);
		  }
    break;

  case 145:
#line 672 "dfgparser.y"
    { if (!dfg_IGNORE && yyvsp[-11].string!=NULL && yyvsp[-9].term!=NULL && !list_Empty(yyvsp[-4].list)) {
		    LIST tupel;
		    RULE Rule = clause_GetOriginFromString(yyvsp[-7].string);
		    string_StringFree(yyvsp[-7].string);
		    /* Build a tuple (label,clause,parentlist,split level,origin) */
		    tupel = list_Cons((POINTER)yyvsp[-2].number,list_List((POINTER)Rule));
		    tupel = list_Cons(yyvsp[-11].string,list_Cons(yyvsp[-9].term,list_Cons(yyvsp[-4].list,tupel)));
		    dfg_PROOFLIST = list_Cons(tupel, dfg_PROOFLIST);
		  } else {
		    /* ignore DNF clauses and clauses with incomplete data */
		    if (yyvsp[-11].string != NULL) string_StringFree(yyvsp[-11].string);
		    if (yyvsp[-9].term != NULL) term_Delete(yyvsp[-9].term);
		    if (yyvsp[-7].string != NULL) string_StringFree(yyvsp[-7].string);
		    dfg_DeleteStringList(yyvsp[-4].list);
		  }
		  dfg_VarCheck();
		}
    break;

  case 146:
#line 692 "dfgparser.y"
    { yyval.list = (dfg_IGNORE||yyvsp[0].string==NULL) ? list_Nil() : list_List(yyvsp[0].string); }
    break;

  case 147:
#line 694 "dfgparser.y"
    { yyval.list = (dfg_IGNORE||yyvsp[0].string==NULL) ? yyvsp[-2].list : list_Nconc(yyvsp[-2].list, list_List(yyvsp[0].string)); }
    break;

  case 148:
#line 698 "dfgparser.y"
    { yyval.number = 0; }
    break;

  case 149:
#line 699 "dfgparser.y"
    { yyval.number = yyvsp[-1].number; }
    break;

  case 150:
#line 703 "dfgparser.y"
    { if (!dfg_IGNORE && yyvsp[-2].string!=NULL && yyvsp[0].string!=NULL && string_Equal(yyvsp[-2].string,"splitlevel"))
		      string_StringToInt(yyvsp[0].string, TRUE, &yyval.number);
		    else
		      yyval.number = 0;
		    if (yyvsp[-2].string != NULL) string_StringFree(yyvsp[-2].string);
		    if (yyvsp[0].string != NULL) string_StringFree(yyvsp[0].string);
		  }
    break;

  case 151:
#line 711 "dfgparser.y"
    { if (!dfg_IGNORE && yyvsp[-2].string!=NULL && yyvsp[0].string!=NULL && string_Equal(yyvsp[-2].string,"splitlevel"))
		      string_StringToInt(yyvsp[0].string, TRUE, &yyval.number);
		    else
		      yyval.number = yyvsp[-4].number;
		    if (yyvsp[-2].string != NULL) string_StringFree(yyvsp[-2].string);
		    if (yyvsp[0].string != NULL) string_StringFree(yyvsp[0].string);
		  }
    break;

  case 152:
#line 721 "dfgparser.y"
    { stack_Push((POINTER) dfg_IGNORE); dfg_IGNORE = TRUE; }
    break;

  case 153:
#line 723 "dfgparser.y"
    { dfg_IGNORE = (BOOL) stack_PopResult();
		    if (yyvsp[0].bool) {
		      if (yyvsp[-2].string != NULL) string_StringFree(yyvsp[-2].string);
		      yyval.string = NULL;
		    } else
		      yyval.string = yyvsp[-2].string;
		  }
    break;

  case 154:
#line 732 "dfgparser.y"
    { yyval.string = yyvsp[0].string; }
    break;

  case 155:
#line 733 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 156:
#line 734 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 157:
#line 735 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 158:
#line 736 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 159:
#line 737 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 160:
#line 738 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 161:
#line 739 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 162:
#line 740 "dfgparser.y"
    { yyval.string = NULL; }
    break;

  case 163:
#line 743 "dfgparser.y"
    { yyval.bool = FALSE; }
    break;

  case 164:
#line 744 "dfgparser.y"
    { yyval.bool = TRUE; }
    break;

  case 165:
#line 745 "dfgparser.y"
    { yyval.bool = TRUE; }
    break;

  case 166:
#line 748 "dfgparser.y"
    { yyval.term = yyvsp[0].term;   }
    break;

  case 167:
#line 749 "dfgparser.y"
    { yyval.term = NULL; }
    break;

  case 170:
#line 761 "dfgparser.y"
    { dfg_VarStart(); }
    break;

  case 171:
#line 762 "dfgparser.y"
    {
                                          dfg_VarStop();
                                          dfg_VarBacktrack();
                                          dfg_VarCheck(); }
    break;

  case 173:
#line 769 "dfgparser.y"
    { dfg_TERMLIST = list_Nconc(dfg_TERMLIST, list_List(yyvsp[-1].term)); }
    break;

  case 177:
#line 781 "dfgparser.y"
    { if (string_Equal(yyvsp[0].string,"SPASS"))
					    dfg_IGNORETEXT = FALSE;
					  string_StringFree(yyvsp[0].string);
					}
    break;

  case 178:
#line 786 "dfgparser.y"
    { dfg_IGNORETEXT = TRUE; }
    break;

  case 179:
#line 789 "dfgparser.y"
    { /* no SPASS flags */
				  string_StringFree(yyvsp[0].string);
				}
    break;

  case 184:
#line 801 "dfgparser.y"
    { SYMBOL s;
		    for ( ; !list_Empty(yyvsp[-1].list); yyvsp[-1].list = list_Pop(yyvsp[-1].list)) {
		      s = symbol_Lookup(list_Car(yyvsp[-1].list));
		      if (s == 0) {
		        misc_StartUserErrorReport();
		        misc_UserErrorReport("\n Undefined symbol %s", list_Car(yyvsp[-1].list));
			misc_UserErrorReport(" in DomPred list.\n"); 
			misc_FinishUserErrorReport(); 
		      }
		      if (!symbol_IsPredicate(s)) {
			misc_StartUserErrorReport();
			misc_UserErrorReport("\n Symbol %s isn't a predicate", list_Car(yyvsp[-1].list));
			misc_UserErrorReport(" in DomPred list.\n");
			misc_FinishUserErrorReport();
		      }
		      string_StringFree(list_Car(yyvsp[-1].list)); 
		      symbol_AddProperty(s, DOMPRED);
		    }
		  }
    break;

  case 185:
#line 821 "dfgparser.y"
    { int flag = flag_Id(yyvsp[-3].string);
		    if (flag == -1) {
		      misc_StartUserErrorReport();
		      misc_UserErrorReport("\n Found unknown flag %s", yyvsp[-3].string);
		      misc_FinishUserErrorReport();
		    }
		    string_StringFree(yyvsp[-3].string);
		    flag_SetFlagValue(dfg_FLAGS, flag, yyvsp[-1].number);
		  }
    break;

  case 188:
#line 837 "dfgparser.y"
    { SYMBOL s = symbol_Lookup(yyvsp[0].string);
		      if (s == 0) {
			misc_StartUserErrorReport();
			misc_UserErrorReport("\n Undefined symbol %s ", yyvsp[0].string);
			misc_UserErrorReport(" in precedence list.\n"); 
			misc_FinishUserErrorReport(); 
		      }
		      string_StringFree(yyvsp[0].string);
		      symbol_SetIncreasedOrdering(dfg_PRECEDENCE, s);
                      dfg_USERPRECEDENCE = list_Cons((POINTER)s, dfg_USERPRECEDENCE);
		    }
    break;

  case 189:
#line 849 "dfgparser.y"
    { SYMBOL s = symbol_Lookup(yyvsp[-4].string);
		      if (s == 0) {
			misc_StartUserErrorReport();
			misc_UserErrorReport("\n Undefined symbol %s", yyvsp[-4].string);
			misc_UserErrorReport("in precedence list.\n");
			misc_FinishUserErrorReport(); 
		      }
		      string_StringFree(yyvsp[-4].string);
		      symbol_SetIncreasedOrdering(dfg_PRECEDENCE, s);
                      dfg_USERPRECEDENCE = list_Cons((POINTER)s, dfg_USERPRECEDENCE);
		      symbol_SetWeight(s, yyvsp[-2].number);
		      if (yyvsp[-1].property != 0)
			symbol_AddProperty(s, yyvsp[-1].property);
		    }
    break;

  case 190:
#line 865 "dfgparser.y"
    { yyval.property = 0; /* left */ }
    break;

  case 191:
#line 867 "dfgparser.y"
    { if (yyvsp[0].string[1] != '\0' ||
			  (yyvsp[0].string[0]!='l' && yyvsp[0].string[0]!='m' && yyvsp[0].string[0]!='r')) {
		         misc_StartUserErrorReport();
			 misc_UserErrorReport("\n Invalid symbol status %s", yyvsp[0].string);
			 misc_UserErrorReport(" in precedence list.");
			 misc_FinishUserErrorReport();
		      }
		      switch (yyvsp[0].string[0]) {
		      case 'm': yyval.property = ORDMUL;   break;
		      case 'r': yyval.property = ORDRIGHT; break;
		      default:  yyval.property = 0;
		      }
		      string_StringFree(yyvsp[0].string);
		    }
    break;

  case 194:
#line 888 "dfgparser.y"
    { dfg_DeleteStringList(yyvsp[-2].list); }
    break;

  case 195:
#line 891 "dfgparser.y"
    { yyval.list = list_List(yyvsp[0].string); }
    break;

  case 196:
#line 892 "dfgparser.y"
    { yyval.list = list_Nconc(yyvsp[-2].list, list_List(yyvsp[0].string)); }
    break;


    }

/* Line 1016 of /opt/gnu//share/bison/yacc.c.  */
#line 2471 "dfgparser.c"

  yyvsp -= yylen;
  yyssp -= yylen;


#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "state stack now");
      while (yyssp1 != yyssp)
	YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;


  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (YYPACT_NINF < yyn && yyn < YYLAST)
	{
	  YYSIZE_T yysize = 0;
	  int yytype = YYTRANSLATE (yychar);
	  char *yymsg;
	  int yyx, yycount;

	  yycount = 0;
	  /* Start YYX at -YYN if negative to avoid negative indexes in
	     YYCHECK.  */
	  for (yyx = yyn < 0 ? -yyn : 0;
	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
	  yysize += yystrlen ("parse error, unexpected ") + 1;
	  yysize += yystrlen (yytname[yytype]);
	  yymsg = (char *) YYSTACK_ALLOC (yysize);
	  if (yymsg != 0)
	    {
	      char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
	      yyp = yystpcpy (yyp, yytname[yytype]);

	      if (yycount < 5)
		{
		  yycount = 0;
		  for (yyx = yyn < 0 ? -yyn : 0;
		       yyx < (int) (sizeof (yytname) / sizeof (char *));
		       yyx++)
		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
		      {
			const char *yyq = ! yycount ? ", expecting " : " or ";
			yyp = yystpcpy (yyp, yyq);
			yyp = yystpcpy (yyp, yytname[yyx]);
			yycount++;
		      }
		}
	      yyerror (yymsg);
	      YYSTACK_FREE (yymsg);
	    }
	  else
	    yyerror ("parse error; also virtual memory exhausted");
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror ("parse error");
    }
  goto yyerrlab1;


/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action.  |
`----------------------------------------------------*/
yyerrlab1:
  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

      /* Return failure if at end of input.  */
      if (yychar == YYEOF)
        {
	  /* Pop the error token.  */
          YYPOPSTACK;
	  /* Pop the rest of the stack.  */
	  while (yyssp > yyss)
	    {
	      YYDPRINTF ((stderr, "Error: popping "));
	      YYDSYMPRINT ((stderr,
			    yystos[*yyssp],
			    *yyvsp));
	      YYDPRINTF ((stderr, "\n"));
	      yydestruct (yystos[*yyssp], *yyvsp);
	      YYPOPSTACK;
	    }
	  YYABORT;
        }

      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
		  yychar, yytname[yychar1]));
      yydestruct (yychar1, yylval);
      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */

  yyerrstatus = 3;	/* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != YYPACT_NINF)
	{
	  yyn += YYTERROR;
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
	    {
	      yyn = yytable[yyn];
	      if (0 < yyn)
		break;
	    }
	}

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
	YYABORT;

      YYDPRINTF ((stderr, "Error: popping "));
      YYDSYMPRINT ((stderr,
		    yystos[*yyssp], *yyvsp));
      YYDPRINTF ((stderr, "\n"));

      yydestruct (yystos[yystate], *yyvsp);
      yyvsp--;
      yystate = *--yyssp;


#if YYDEBUG
      if (yydebug)
	{
	  short *yyssp1 = yyss - 1;
	  YYFPRINTF (stderr, "Error: state stack now");
	  while (yyssp1 != yyssp)
	    YYFPRINTF (stderr, " %d", *++yyssp1);
	  YYFPRINTF (stderr, "\n");
	}
#endif
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  YYDPRINTF ((stderr, "Shifting error token, "));

  *++yyvsp = yylval;


  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here.  |
`----------------------------------------------*/
yyoverflowlab:
  yyerror ("parser stack overflow");
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}


#line 895 "dfgparser.y"


void yyerror(const char *s)
{
  misc_StartUserErrorReport();
  misc_UserErrorReport("\n Line %i: %s\n", dfg_LINENUMBER, s);
  misc_FinishUserErrorReport();
}

static void dfg_Init(FILE* Input, FLAGSTORE Flags, PRECEDENCE Precedence)
/**************************************************************
  INPUT:   The input file stream for the parser, a flag store and
           a precedence.
  RETURNS: Nothing.
  EFFECT:  The parser and scanner are initialized.
           The parser will use the flag store and the precedence
	   to memorize the settings from the input file.
***************************************************************/
{
  extern FILE* dfg_in;  /* declared in dfgscanner */

  dfg_in               = Input;
  dfg_LINENUMBER       = 1;
  dfg_IGNORETEXT       = TRUE;
  dfg_AXIOMLIST        = list_Nil();
  dfg_CONJECLIST       = list_Nil();
  dfg_SORTDECLLIST     = list_Nil();
  dfg_USERPRECEDENCE   = list_Nil();
  dfg_AXCLAUSES        = list_Nil();
  dfg_CONCLAUSES       = list_Nil();
  dfg_PROOFLIST        = list_Nil();
  dfg_TERMLIST         = list_Nil();
  dfg_SYMBOLLIST       = list_Nil();
  dfg_VARLIST          = list_Nil();
  dfg_VARDECL          = FALSE;
  dfg_IGNORE           = FALSE;
  dfg_FLAGS            = Flags;
  dfg_PRECEDENCE       = Precedence;
  dfg_DESC.name        = (char*) NULL;
  dfg_DESC.author      = (char*) NULL;
  dfg_DESC.version     = (char*) NULL;
  dfg_DESC.logic       = (char*) NULL;
  dfg_DESC.status      = DFG_UNKNOWNSTATE;
  dfg_DESC.description = (char*) NULL;
  dfg_DESC.date        = (char*) NULL;
}


void dfg_Free(void)
/**************************************************************
  INPUT:   None.
  RETURNS: Nothing.
  EFFECT:  Frees memory used by the problem description.
***************************************************************/
{
  if (dfg_DESC.name != NULL)
    string_StringFree(dfg_DESC.name);
  if (dfg_DESC.author != NULL)
    string_StringFree(dfg_DESC.author);
  if (dfg_DESC.version != NULL)
    string_StringFree(dfg_DESC.version);
  if (dfg_DESC.logic != NULL)
    string_StringFree(dfg_DESC.logic);
  if (dfg_DESC.description != NULL)
    string_StringFree(dfg_DESC.description);
  if(dfg_DESC.date != NULL)
    string_StringFree(dfg_DESC.date);
}

const char* dfg_ProblemName(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The problem's name from the description section.
***************************************************************/
{
  return dfg_DESC.name;
}

const char* dfg_ProblemAuthor(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The problem's author from the description section.
***************************************************************/
{
  return dfg_DESC.author;
}

const char* dfg_ProblemVersion(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The problem's version from the description section.
***************************************************************/
{
  return dfg_DESC.version;
}

const char* dfg_ProblemLogic(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The problem's logic from the description section.
***************************************************************/
{
  return dfg_DESC.logic;
}

DFG_STATE dfg_ProblemStatus(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The problem's status from the description section.
***************************************************************/
{
  return dfg_DESC.status;
}

const char* dfg_ProblemStatusString(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The string representation of the problem's status.
***************************************************************/
{
  const char* result = "";

  switch (dfg_DESC.status) {
  case DFG_SATISFIABLE:
    result = "satisfiable"; break;
  case DFG_UNSATISFIABLE:
    result = "unsatisfiable"; break;
  case DFG_UNKNOWNSTATE:
    result = "unknown"; break;
  default:
    misc_StartErrorReport();
    misc_ErrorReport("\n In dfg_ProblemStatusString: Invalid status.\n");
    misc_FinishErrorReport();
  }
  return result;
}

const char* dfg_ProblemDescription(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The problem's description from the description section.
***************************************************************/
{
  return dfg_DESC.description;
}

const char* dfg_ProblemDate(void)
/**************************************************************
  INPUT:   None.
  RETURNS: The problem's date from the description section.
***************************************************************/
{
  return dfg_DESC.date;
}

void dfg_FPrintDescription(FILE* File)
/**************************************************************
  INPUT:   A file stream.
  RETURNS: Nothing.
  EFFECT:  The description section from the input file
           is printed to 'File'. You must call the parser first
           before calling this function.
***************************************************************/
{
  fputs("list_of_descriptions.\n  name(", File);
  if (dfg_DESC.name != NULL)
    fputs(dfg_DESC.name, File);
  else
    fputs("{* *}", File);
  fputs(").\n  author(", File);
  if (dfg_DESC.author != NULL)
    fputs(dfg_DESC.author, File);
  else
    fputs("{* *}", File);
  fputs(").\n", File);
  if (dfg_DESC.version != NULL) {
    fputs("  version(", File);
    fputs(dfg_DESC.version, File);
    fputs(").\n", File);
  }
  if (dfg_DESC.logic != NULL) {
    fputs("  logic(", File);
    fputs(dfg_DESC.logic, File);
    fputs(").\n", File);
  }
  fputs("  status(", File);
  fputs(dfg_ProblemStatusString(), File);
  fputs(").\n  description(", File);
  if (dfg_DESC.description != NULL)
    fputs(dfg_DESC.description, File);
  else
    fputs("{* *}", File);
  fputs(").\n", File);
  if (dfg_DESC.date != NULL) {
    fputs("  date(", File);
    fputs(dfg_DESC.date, File);
    fputs(").\n", File);
  }
  fputs("end_of_list.", File);
}


LIST dfg_DFGParser(FILE* File, FLAGSTORE Flags, PRECEDENCE Precedence,
		   LIST* Axioms, LIST* Conjectures, LIST* SortDecl,
		   LIST* UserDefinedPrecedence)
/**************************************************************
  INPUT:   The input file containing clauses or formulae in DFG syntax,
           a flag store and a precedence used to memorize settings
	   from the file.
           Axioms, Conjectures, SortDecl and UserDefinedPrecedence are
	   pointers to lists used as return values.
  RETURNS: The list of clauses from File.
  EFFECT:  Reads formulae and clauses from the input file.
           The axioms, conjectures, sort declarations and user-defined
	   precedences are appended to the respective lists, the lists
	   are not deleted!
	   All lists except the clause list contain pairs
	   (label, term), where <label> may be NULL, if no
	   label was specified for that term.
	   <UserDefinedPrecedence> contains symbols sorted by decreasing
	   precedence. This list will only be changed, if the precedence
	   is explicitly defined in the input file. This can be done
	   by the 'set_precedence' flag in the SPASS settings list in
	   the DFG input file.
  CAUTION: The weight of the clauses is not correct and the literals
           are not oriented!
***************************************************************/
{
  LIST  scan, tupel;
  TERM  clauseTerm;
  NAT   bottom;

  dfg_Init(File, Flags, Precedence);  /* Initialize the parser and scanner */
  bottom = stack_Bottom();
  dfg_parse();          /* Invoke the parser */
#ifdef CHECK 
  if (!stack_Empty(bottom)) {
    misc_StartErrorReport();
    misc_ErrorReport("\n In dfg_DFGParser: Stack not empty!\n");
    misc_FinishErrorReport();
  }
#endif
  dfg_SymCleanUp();

  /* Remove clause labels and create clauses from the terms */
  for (scan = dfg_AXCLAUSES; !list_Empty(scan); scan = list_Cdr(scan)) {
    tupel = list_Car(scan);
    clauseTerm = list_PairSecond(tupel);
    list_Rplaca(scan, dfg_CreateClauseFromTerm(clauseTerm,TRUE, Flags, Precedence));
    if (list_PairFirst(tupel) != NULL)        /* Label is defined */
      string_StringFree(list_PairFirst(tupel));  /* Delete the label */
    list_PairFree(tupel);
  }
  /* Since dfg_CreateClauseFromTerm() returns NULL for trivial tautologies */
  /* we now delete those NULL pointers from the clause list.               */
  dfg_AXCLAUSES = list_PointerDeleteElement(dfg_AXCLAUSES, NULL);
  for (scan = dfg_CONCLAUSES; !list_Empty(scan); scan = list_Cdr(scan)) {
    tupel = list_Car(scan);
    clauseTerm = list_PairSecond(tupel);
    list_Rplaca(scan, dfg_CreateClauseFromTerm(clauseTerm,FALSE, Flags, Precedence));
    if (list_PairFirst(tupel) != NULL)        /* Label is defined */
      string_StringFree(list_PairFirst(tupel));  /* Delete the label */
    list_PairFree(tupel);
  }
  /* Since dfg_CreateClauseFromTerm() returns NULL for trivial tautologies */
  /* we now delete those NULL pointers from the clause list.               */
  dfg_CONCLAUSES = list_PointerDeleteElement(dfg_CONCLAUSES, NULL);

  /* Delete the proof list */
  dfg_DeleteProofList(dfg_PROOFLIST);

  /* Delete the list_of_terms, since it'll be ignored */
  term_DeleteTermList(dfg_TERMLIST);

  scan = list_Nconc(dfg_AXCLAUSES, dfg_CONCLAUSES);

  *Axioms      = list_Nconc(*Axioms, dfg_AXIOMLIST);
  *Conjectures = list_Nconc(*Conjectures, dfg_CONJECLIST);
  *SortDecl    = list_Nconc(*SortDecl, dfg_SORTDECLLIST);
  list_NReverse(dfg_USERPRECEDENCE);
  *UserDefinedPrecedence = list_Nconc(*UserDefinedPrecedence, dfg_USERPRECEDENCE);

  return scan;
}


LIST dfg_ProofParser(FILE* File, FLAGSTORE Flags, PRECEDENCE Precedence)
/**************************************************************
  INPUT:   The input file containing clauses in DFG syntax,
           a flag store and a precedence used to memorize settings
           from the file.
  RETURNS: A list of tuples (label,clause,justificationlist,splitlevel,origin)
           representing a proof.
  EFFECT:  Reads inputs clauses with labels and the proof lists
           from the input file.
           The elements of the list are lists with five items.
	   1. the label (a string) of a clause,
	   2. the clause in TERM format,
           3. the list of justification labels (strings, too),
           4. the split level of the clause,
           5. the origin of the clause (RULE struct from clause.h).
	   Note that the justification list is empty for input
	   clauses.
***************************************************************/
{
  LIST  scan, tupel;
  TERM  term;
  NAT   bottom;

  dfg_Init(File, Flags, Precedence);  /* Initialize the parser and scanner */
  bottom = stack_Bottom();
  dfg_parse();          /* Invoke the parser */
#ifdef CHECK 
  if (!stack_Empty(bottom)) {
    misc_StartErrorReport();
    misc_ErrorReport("\n In dfg_ProofParser: Stack not empty!\n");
    misc_FinishErrorReport();
  }
#endif

  dfg_SymCleanUp();

  /* Build the union of axiom and conjecture clauses */
  dfg_AXCLAUSES  = list_Nconc(dfg_AXCLAUSES, dfg_CONCLAUSES);
  dfg_CONCLAUSES = list_Nil();
  for (scan = dfg_AXCLAUSES; !list_Empty(scan); scan = list_Cdr(scan)) {
    tupel = list_Car(scan);
    term  = list_PairSecond(tupel);
    if (list_PairFirst(tupel) == NULL) {
      /* Ignore input clauses without label */
      term_Delete(term);
      list_PairFree(tupel);
      list_Rplaca(scan, NULL);
    } else
      /* Expand the pair to a tuple                            */
      /* (label,clause,justificationlist, split level, origin) */
      /* For input clauses the justificationlist is empty.     */
      /* Input clauses have split level 0.                     */
      list_Rplacd(tupel, list_Cons(term,list_Cons(list_Nil(),list_Cons(0, list_List((POINTER)INPUT)))));
  }
  /* Now delete the list items without labels */
  dfg_AXCLAUSES = list_PointerDeleteElement(dfg_AXCLAUSES, NULL);

  /* Delete the formula lists */
  dfg_DeleteFormulaPairList(dfg_AXIOMLIST);
  dfg_DeleteFormulaPairList(dfg_CONJECLIST);
  /* Delete the list of sort declarations */
  dfg_DeleteFormulaPairList(dfg_SORTDECLLIST);
  /* Delete the list_of_terms, since it'll be ignored */
  term_DeleteTermList(dfg_TERMLIST);

  /* Finally append the proof list to the list of input clauses with labels */
  dfg_PROOFLIST = list_NReverse(dfg_PROOFLIST);
  dfg_AXCLAUSES = list_Nconc(dfg_AXCLAUSES, dfg_PROOFLIST);

  return dfg_AXCLAUSES;
}


LIST dfg_TermParser(FILE* File, FLAGSTORE Flags, PRECEDENCE Precedence)
/**************************************************************
  INPUT:   The input file containing a list of terms in DFG syntax,
           a flag store and a precedence used to memorize settings
	   from the file.
  RETURNS: The list of terms from <File>.
  EFFECT:  Reads terms from the list_of_terms from the input file.
***************************************************************/
{
  NAT bottom;
  
  dfg_Init(File, Flags, Precedence);   /* Initialize the parser and scanner */
  bottom = stack_Bottom();
  dfg_parse();          /* Invoke the parser */
#ifdef CHECK 
  if (!stack_Empty(bottom)) {
    misc_StartErrorReport();
    misc_ErrorReport("\n In dfg_TermParser: Stack not empty!\n");
    misc_FinishErrorReport();
  }
#endif

  dfg_SymCleanUp();

  /* Delete the clause lists */
  dfg_DeleteFormulaPairList(dfg_AXCLAUSES);
  dfg_DeleteFormulaPairList(dfg_CONCLAUSES);
  /* Delete the formula lists */
  dfg_DeleteFormulaPairList(dfg_AXIOMLIST);
  dfg_DeleteFormulaPairList(dfg_CONJECLIST);
  /* Delete the proof list */
  dfg_DeleteProofList(dfg_PROOFLIST);
  /* Delete the list of sort declarations */
  dfg_DeleteFormulaPairList(dfg_SORTDECLLIST);

  return dfg_TERMLIST;
}


void dfg_DeleteFormulaPairList(LIST FormulaPairs)
/**************************************************************
  INPUT:   A list of pairs (label, formula).
  RETURNS: Nothing.
  EFFECT:  The list and the pairs with their strings and terms
           are completely deleted.
***************************************************************/
{
  LIST pair;

  for ( ; !list_Empty(FormulaPairs); FormulaPairs = list_Pop(FormulaPairs)) {
    pair = list_Car(FormulaPairs);  /* (label, term) */
    term_Delete(list_PairSecond(pair));
    if (list_PairFirst(pair) != NULL)
      string_StringFree(list_PairFirst(pair));  /* Free the label */
    list_PairFree(pair);
  }
}

void dfg_StripLabelsFromList(LIST FormulaPairs)
/**************************************************************
  INPUT:   A list of pairs (label, formula).
  RETURNS: Nothing.
  EFFECT:  The pairs are replaced by the respective formula
           and the pairs with their label strings are deleted.
***************************************************************/
{
  LIST pair, scan;

  for (scan = FormulaPairs; !list_Empty(scan); scan = list_Cdr(scan)) {
    pair = list_Car(scan);  /* (label, term) */
    list_Rplaca(scan, list_PairSecond(pair));
    if (list_PairFirst(pair) != NULL)
      string_StringFree(list_PairFirst(pair));  /* Free the label */
    list_PairFree(pair);
  }
}

void dfg_DeleteProofList(LIST Proof)
/**************************************************************
  INPUT:   A list of tuples (label, term, justificationlist, split level).
  RETURNS: Nothing.
  EFFECT:  All memory used by the proof list is freed.
           The labels must NOT be NULL entries!
***************************************************************/
{
  /* Delete the proof list */
  for ( ; !list_Empty(Proof); Proof = list_Pop(Proof)) {
    LIST tupel = list_Car(Proof);
    string_StringFree(list_First(tupel));
    term_Delete(list_Second(tupel));
    dfg_DeleteStringList(list_Third(tupel));
    list_Delete(tupel);
  }
}

/**************************************************************/
/* Static Functions                                           */
/**************************************************************/

static void dfg_SymbolDecl(int SymbolType, char* Name, int Arity)
/**************************************************************
  INPUT:   The type of a symbol, the name, and the arity.
  RETURNS: Nothing.
  EFFECT:  This function handles the declaration of symbols.
           If <Arity> is -2, it means that the arity of the symbol
	   was not specified, if it is -1 the symbol is declared
	   with arbitrary arity. User defined symbols with arbitrary
           arity are not allowed.
	   The <Name> is deleted.
***************************************************************/
{
  NAT    arity, length;
  SYMBOL symbol;

  switch (Arity) {
  case -2: /* not specified */
    arity = 0;
    break;
  case -1:
    misc_StartUserErrorReport();
    misc_UserErrorReport("\n Line %u: symbols with arbitrary arity are not allowed.\n",
	    dfg_LINENUMBER);
    misc_FinishUserErrorReport();
  default:
    arity = Arity;
}

  /* Pay attention to the maximum symbol name length */
  length = strlen(Name);
  if (length >= symbol__SYMBOLMAXLEN)
    Name[symbol__SYMBOLMAXLEN-1] = '\0';

  /* Check if this symbol was declared earlier */
  symbol = symbol_Lookup(Name);
  if (symbol != 0) {
    /* Symbol was declared before */
    /* Check if the old and new symbol type are equal */
    if ((SymbolType == DFG_FUNC && !symbol_IsFunction(symbol)) ||
	(SymbolType == DFG_PRDICAT && !symbol_IsPredicate(symbol)) ||
	((SymbolType == DFG_OPERAT || SymbolType == DFG_QUANTIF) && 
	 !symbol_IsJunctor(symbol))) {
      misc_StartUserErrorReport();
      misc_UserErrorReport("\n Line %u: symbol %s was already declared as ",
	      dfg_LINENUMBER, Name);
      switch (symbol_Type(symbol)) {
      case symbol_CONSTANT:
      case symbol_FUNCTION:
	misc_UserErrorReport("function.\n"); break;
      case symbol_PREDICATE:
	misc_UserErrorReport("predicate.\n"); break;
      case symbol_JUNCTOR:
	misc_UserErrorReport("junctor.\n"); break;
      default:
	misc_UserErrorReport("unknown type.\n");
      }
      misc_FinishUserErrorReport();
    }
    /* Now check the old and new arity if specified */
    if (Arity != -2 && Arity != symbol_Arity(symbol)) {
      misc_StartUserErrorReport();
      misc_UserErrorReport("\n Line %u: symbol %s was already declared with arity %d\n",
			   dfg_LINENUMBER, Name, symbol_Arity(symbol));
      misc_FinishUserErrorReport();
    }
  } else {
    /* Symbol was not declared before */
    switch (SymbolType) {
    case DFG_FUNC:
      symbol = symbol_CreateFunction(Name, arity, symbol_STATLEX,dfg_PRECEDENCE);
      break;
    case DFG_PRDICAT:
      symbol = symbol_CreatePredicate(Name, arity,symbol_STATLEX,dfg_PRECEDENCE);
      break;
    default:
      symbol = symbol_CreateJunctor(Name, arity, symbol_STATLEX, dfg_PRECEDENCE);
    }
    if (Arity == -2)
      /* Arity wasn't specified so check the arity for each occurrence */
      dfg_SymAdd(symbol);
  }

  if (length >= symbol__SYMBOLMAXLEN) {
    /* To avoid a memory error restore the old string length */
    Name[symbol__SYMBOLMAXLEN-1] = ' ';  /* Something != '\0' */
  }
  string_StringFree(Name);  /* Name was copied */
}


static SYMBOL dfg_Symbol(char* Name, NAT Arity)
/**************************************************************
  INPUT:   The name of a symbol and the actual arity of the symbol.
  RETURNS: The corresponding SYMBOL.
  EFFECT:  This function checks if the <Name> was declared as
           symbol or variable. If not, an error message is printed
	   to stderr.
	   The <Name> is deleted.
***************************************************************/
{
  SYMBOL symbol;
  char   old;
  NAT    length;

  old = ' ';  /* Just to avoid a compiler warning */
  /* Pay attention to the maximum symbol name length */
  length = strlen(Name);
  if (length >= symbol__SYMBOLMAXLEN) {
    old = Name[symbol__SYMBOLMAXLEN-1];
    Name[symbol__SYMBOLMAXLEN-1] = '\0';
  }

  symbol = symbol_Lookup(Name);
  if (length >= symbol__SYMBOLMAXLEN) {
    /* To avoid a memory error restore the old string */
    Name[symbol__SYMBOLMAXLEN-1] = old;
  }
  if (symbol != 0) {
    string_StringFree(Name);
    dfg_SymCheck(symbol, Arity); /* Check the arity */
  } else {
    /* Variable */
    if (Arity > 0) {
      misc_StartUserErrorReport();
      misc_UserErrorReport("\n Line %d: Undefined symbol %s.\n",dfg_LINENUMBER,Name);
      misc_FinishUserErrorReport();
    }
    symbol = dfg_VarLookup(Name);
  }
  return symbol;
}


TERM dfg_CreateQuantifier(SYMBOL Symbol, LIST VarTermList, TERM Term)
/**************************************************************
  INPUT:   A quantifier symbol, a list possibly containing sorts,
           and a term.
  RETURNS: The created quantifier term..
***************************************************************/
{
  LIST varlist, sortlist, scan;
  TERM helpterm;

  /* First collect the variable symbols in varlist and the sorts in sortlist */
  varlist = sortlist = list_Nil();
  for ( ; !list_Empty(VarTermList); VarTermList = list_Pop(VarTermList)) {
    helpterm = list_Car(VarTermList);
    if (term_IsVariable(helpterm)) {
      varlist = list_Nconc(varlist, list_List((POINTER)term_TopSymbol(helpterm)));
      term_Delete(helpterm);
    } else {
      SYMBOL var = term_TopSymbol(term_FirstArgument(helpterm));
      varlist  = list_Nconc(varlist, list_List((POINTER)var));
      sortlist = list_Nconc(sortlist, list_List(helpterm));
    }
  }

  varlist = list_PointerDeleteDuplicates(varlist);
  /* Now create terms from the variables */
  for (scan = varlist; !list_Empty(scan); scan = list_Cdr(scan))
    list_Rplaca(scan, term_Create((SYMBOL)list_Car(scan), list_Nil()));

  if (!list_Empty(sortlist)) {
    if (symbol_Equal(fol_All(), Symbol)) {
      /* The conjunction of all sortterms implies the Term */
      if (symbol_Equal(fol_Or(), term_TopSymbol(Term))) {
	/* Special treatment if <Term> is a term with "or" like */
	/* in clauses: add all sort terms negated to the args    */
	/* of the "or" */
	for (scan = sortlist; !list_Empty(scan); scan = list_Cdr(scan))
	  /* Negate the sort terms */
	  list_Rplaca(scan, term_Create(fol_Not(), list_List(list_Car(scan))));
	sortlist = list_Nconc(sortlist, term_ArgumentList(Term));
	term_RplacArgumentList(Term, sortlist);
      } else {
	/* No "or" term, so build the implication term */
	if (list_Empty(list_Cdr(sortlist))) {
	  /* Only one sort term */
	  list_Rplacd(sortlist, list_List(Term));
	  Term = term_Create(fol_Implies(), sortlist);
	} else {
	  /* More than one sort term */
	  helpterm = term_Create(fol_And(), sortlist);
	  Term = term_Create(fol_Implies(), list_Cons(helpterm, list_List(Term)));
	}
      }
    } else if (symbol_Equal(fol_Exist(), Symbol)) {
      /* Quantify the conjunction of all sort terms and <Term> */
      if (symbol_Equal(fol_And(), term_TopSymbol(Term))) {
	/* Special treatment if <Term> has an "and" as top symbol: */
	/* just add the sort terms to the args of the "and".       */
	sortlist = list_Nconc(sortlist, term_ArgumentList(Term));
	term_RplacArgumentList(Term, sortlist);
      } else {
	sortlist = list_Nconc(sortlist, list_List(Term));
	Term = term_Create(fol_And(), sortlist);
      }
    }
  }
  helpterm = fol_CreateQuantifier(Symbol, varlist, list_List(Term));
  return helpterm;
}


CLAUSE dfg_CreateClauseFromTerm(TERM Clause, BOOL IsAxiom, FLAGSTORE Flags,
				PRECEDENCE Precedence)
/**************************************************************
  INPUT:   A clause term, a boolean value, a flag store and a precedence.
  RETURNS: The clause term converted to a CLAUSE or NULL if the
           clause is a trivial tautology (the clause contains
	   the literal "true" or "not(false)" ).
  EFFECT:  This function converts a clause stored as term into an
           EARL clause structure.
	   If 'IsAxiom' is TRUE the clause is treated as axiom
	   clause else as conjecture clause.
           The function deletes the literals "false" and "not(true)"
           if they occur in <Clause>.
	   The contents of the flag store and the precedence are changed
	   because the parser read flag and precedence settings from
	   
  MEMORY:  The clause term is deleted.
***************************************************************/
{
  LIST   literals, scan;
  TERM   literal;
  CLAUSE result;
  
  if (term_TopSymbol(Clause) == fol_All()) {
    /* Remove and free the quantifier and the OR term */
    literals = term_ArgumentList(term_SecondArgument(Clause));
    term_RplacArgumentList(term_SecondArgument(Clause), list_Nil());
  } else {
    /* Remove and free the OR term */
    literals = term_ArgumentList(Clause);
    term_RplacArgumentList(Clause, list_Nil());
  }
  term_Delete(Clause);

  for (scan = literals; !list_Empty(scan); scan = list_Cdr(scan)) {
    literal = (TERM) list_Car(scan);
    if (symbol_IsPredicate(term_TopSymbol(literal))) {  /* Positive literal */
      if (fol_IsTrue(literal)) {
	/* Clause is a tautology */
	list_PointerDeleteElement(literals, NULL);
	/* Remove possible NULL elements to avoid a crash in term_Delete */
	term_DeleteTermList(literals);
	return (CLAUSE) NULL;
      } else if (fol_IsFalse(literal)) {
	/* Ignore this literal */
	term_Delete(literal);
	list_Rplaca(scan, NULL); /* Mark the actual list element */
      }
    } else {
      /* Found a negative literal */
      TERM atom = term_FirstArgument(literal);
      if (fol_IsFalse(atom)) {
	/* Clause is a tautology */
	list_PointerDeleteElement(literals, NULL);
	/* Remove possible NULL elements to avoid a crash in term_Delete */
	term_DeleteTermList(literals);
	return (CLAUSE) NULL;
      } else if (fol_IsTrue(atom)) {
	/* Ignore this literal */
	term_Delete(literal);
	list_Rplaca(literals, NULL); /* Mark the actual list element */
      }
    }
  }

  literals = list_PointerDeleteElement(literals, NULL);
  /* Remove the special literals treated above from the list */
  result = clause_CreateFromLiterals(literals, FALSE, !IsAxiom, FALSE, Flags, Precedence);
  /* Don't create sorts! */
  list_Delete(literals);

  return result;
}


static void dfg_SubSort(char* Name1, char* Name2)
/**************************************************************
  INPUT:   Two sort symbol names.
  RETURNS: Nothing.
  EFFECT:  This functions adds the formula
           forall([U], implies(Name1(U), Name2(U)))
	   to the list of axiom formulas. Both <Name1> and <Name2>
	   are deleted.
***************************************************************/
{
  SYMBOL s1, s2;
  TERM   varterm, t1, t2, term;

  s1 = dfg_Symbol(Name1, 1);   /* Should be unary predicates */
  s2 = dfg_Symbol(Name2, 1);
  if (!symbol_IsPredicate(s1)) {
    misc_StartUserErrorReport();
    misc_UserErrorReport("\n Line %d: Symbol is not a sort predicate.\n", dfg_LINENUMBER);
    misc_FinishUserErrorReport();
  }
  if (!symbol_IsPredicate(s2)) {
    misc_StartUserErrorReport();
    misc_UserErrorReport("\n Line %d: Symbol is not a sort predicate.\n", dfg_LINENUMBER);
    misc_FinishUserErrorReport();
  }

  varterm = term_Create(symbol_CreateStandardVariable(), list_Nil());
  symbol_ResetStandardVarCounter();
  
  t1   = term_Create(s1, list_List(varterm));
  t2   = term_Create(s2, list_List(term_Copy(varterm)));
  term = term_Create(fol_Implies(), list_Cons(t1, list_List(t2)));
  term = fol_CreateQuantifier(fol_All(), list_List(term_Copy(varterm)),
			      list_List(term));
  dfg_SORTDECLLIST = list_Nconc(dfg_SORTDECLLIST, list_List(list_PairCreate(NULL,term)));
}


static void dfg_SymbolGenerated(SYMBOL SortPredicate, BOOL FreelyGenerated,
				LIST GeneratedBy)
/**************************************************************
  INPUT:   A sort predicate, a boolean flag, and a list of function
           symbol names.
  RETURNS: Nothing.
  EFFECT:  This function stores the information that the <SortPredicate>
           is generated by the function symbols from the <GeneratedBy>
           list. The list contains only symbol names!
	   The <SortPredicate> AND the symbols from the list get
           the property GENERATED. Additionally the symbols get
	   the property FREELY, if the flag <FreelyGenerated> is TRUE.
***************************************************************/
{
  SYMBOL symbol;
  LIST   scan;

  if (!symbol_IsPredicate(SortPredicate)) {
    misc_StartUserErrorReport();
    misc_UserErrorReport("\n Line %d: Symbol is not a sort predicate.\n", dfg_LINENUMBER);
    misc_FinishUserErrorReport();
  }
  /* First reset the old information */
  symbol_RemoveProperty(SortPredicate, GENERATED);
  symbol_RemoveProperty(SortPredicate, FREELY);
  list_Delete(symbol_GeneratedBy(SortPredicate));
  /* Now set the new information */
  symbol_AddProperty(SortPredicate, GENERATED);
  if (FreelyGenerated)
    symbol_AddProperty(SortPredicate, FREELY);
  for (scan = GeneratedBy; !list_Empty(scan); scan = list_Cdr(scan)) {
    symbol = symbol_Lookup(list_Car(scan));
    if (symbol == 0) {
      misc_StartUserErrorReport();
      misc_UserErrorReport("\n Line %d: undefined symbol %s.\n", dfg_LINENUMBER,
			   (char*)list_Car(scan));
      misc_FinishUserErrorReport();
    } else if (!symbol_IsFunction(symbol)) { /* must be function or constant */
      misc_StartUserErrorReport();
      misc_UserErrorReport("\n Line %d: Symbol is not a function.\n", dfg_LINENUMBER);
      misc_FinishUserErrorReport();
    }
    string_StringFree(list_Car(scan));
    list_Rplaca(scan, (POINTER)symbol);  /* change the name list to a symbol list */
    /* Set GENERATED properties for generating symbols */
    symbol_AddProperty(symbol, GENERATED);
    if (FreelyGenerated)
      symbol_AddProperty(symbol, FREELY);
  }
  symbol_SetGeneratedBy(SortPredicate, GeneratedBy);
}


/**************************************************************/
/* Functions for the Symbol Table                             */
/**************************************************************/

typedef struct {
  SYMBOL symbol;
  BOOL   valid;
  int    arity;
} DFG_SYMENTRY, *DFG_SYM;

static __inline__ DFG_SYM dfg_SymCreate(void)
{
  return (DFG_SYM) memory_Malloc(sizeof(DFG_SYMENTRY));
}

static __inline__ void dfg_SymFree(DFG_SYM Entry)
{
  memory_Free(Entry, sizeof(DFG_SYMENTRY));
}


static void dfg_SymAdd(SYMBOL Symbol)
/**************************************************************
  INPUT:   A symbol.
  RETURNS: Nothing.
  EFFECT:  This function adds 'Symbol' to the symbol list.
           The arity of these symbols will be checked every time
	   the symbol occurs.
***************************************************************/
{
  DFG_SYM newEntry = dfg_SymCreate();
  newEntry->symbol = Symbol;
  newEntry->valid  = FALSE;
  newEntry->arity  = 0;
  dfg_SYMBOLLIST = list_Cons(newEntry, dfg_SYMBOLLIST);
}


static void dfg_SymCheck(SYMBOL Symbol, NAT Arity)
/**************************************************************
  INPUT:   A symbol and the current arity of this symbol.
  RETURNS: Nothing.
  EFFECT:  This function compares the previous arity of 'Symbol'
           with the actual 'Arity'. If these values differ
	   the symbol's arity is set to arbitrary.
	   The arity of symbols whose arity was specified in
	   the symbol declaration section is checked and a warning
	   is printed to stderr in case of differences.
***************************************************************/
{
  LIST scan = dfg_SYMBOLLIST;
  while (!list_Empty(scan)) {
    DFG_SYM actEntry = (DFG_SYM) list_Car(scan);
    if (actEntry->symbol == Symbol) {
      if (actEntry->valid) {
	if (actEntry->arity != Arity) {
	  misc_StartUserErrorReport();
	  misc_UserErrorReport("\n Line %u:", dfg_LINENUMBER);
	  misc_UserErrorReport(" The actual arity %u", Arity);
	  misc_UserErrorReport(" of symbol %s differs", symbol_Name(Symbol));
	  misc_UserErrorReport(" from the previous arity %u.\n", actEntry->arity);
	  misc_FinishUserErrorReport();
	}
      } else {
	/* Not valid => first time */
	actEntry->arity = Arity;
	actEntry->valid = TRUE;
      }
      return;
    }
    scan = list_Cdr(scan);
  }

  /* Symbol isn't in SymbolList, so its arity was specified.        */
  /* Check if the specified arity corresponds with the actual arity */
  if (symbol_Arity(Symbol) != Arity) {
    misc_StartUserErrorReport();
    misc_UserErrorReport("\n Line %u: Symbol %s was declared with arity %u.\n",
			 dfg_LINENUMBER, symbol_Name(Symbol), symbol_Arity(Symbol));
    misc_FinishUserErrorReport();
  }
}


static void dfg_SymCleanUp(void)
/**************************************************************
  INPUT:   None.
  RETURNS: Nothing.
  EFFECT:  This function corrects all symbols whose arity wasn't
           specified in the symbol declaration section but seem
	   to occur with always the same arity.
	   The memory for the symbol list is freed.
***************************************************************/
{
  while (!list_Empty(dfg_SYMBOLLIST)) {
    DFG_SYM actEntry  = (DFG_SYM) list_Car(dfg_SYMBOLLIST);
    SYMBOL  actSymbol = actEntry->symbol;

    if (actEntry->arity != symbol_Arity(actSymbol))
      symbol_SetArity(actSymbol, actEntry->arity);

    dfg_SymFree(actEntry);
    dfg_SYMBOLLIST = list_Pop(dfg_SYMBOLLIST);
  }
}


/**************************************************************/
/* Functions for the Variable Table                           */
/**************************************************************/
  
typedef struct {
  char*  name;
  SYMBOL symbol;
} DFG_VARENTRY, *DFG_VAR;

static __inline__ char* dfg_VarName(DFG_VAR Entry)
{
  return Entry->name;
}

static __inline__ SYMBOL dfg_VarSymbol(DFG_VAR Entry)
{
  return Entry->symbol;
}

static __inline__ DFG_VAR dfg_VarCreate(void)
{
  return (DFG_VAR) memory_Malloc(sizeof(DFG_VARENTRY));
}

static void dfg_VarFree(DFG_VAR Entry)
{
  string_StringFree(Entry->name);
  memory_Free(Entry, sizeof(DFG_VARENTRY));
}

static void dfg_VarStart(void)
{
  dfg_VARLIST = list_Push(list_Nil(), dfg_VARLIST);
  dfg_VARDECL = TRUE;
}

static void dfg_VarStop(void)
{
  dfg_VARDECL = FALSE;
}

static void dfg_VarBacktrack(void)
{
  list_DeleteWithElement(list_Top(dfg_VARLIST), (void (*)(POINTER)) dfg_VarFree);
  dfg_VARLIST = list_Pop(dfg_VARLIST);
}

static void dfg_VarCheck(void)
/* Should be called after a complete clause or formula was parsed */
{
  if (!list_Empty(dfg_VARLIST)) {
    misc_StartErrorReport();
    misc_ErrorReport("\n In dfg_VarCheck: List of variables should be empty!\n");
    misc_FinishErrorReport();
  }
  symbol_ResetStandardVarCounter();
}

static SYMBOL dfg_VarLookup(char* Name)
/**************************************************************
  INPUT:   A variable name.
  RETURNS: The corresponding variable symbol.
  EFFECT:  If the variable name was quantified before, the
           corresponding symbol is returned and the <Name> is freed.
	   If the variable name was not quantified, and <dfg_VARDECL>
	   is TRUE, a new variable is created, else an error
	   message is printed and the program exits.
***************************************************************/
{
  LIST   scan, scan2;
  SYMBOL symbol = symbol_Null();

  scan  = dfg_VARLIST;
  scan2 = list_Nil();
  while (!list_Empty(scan) && list_Empty(scan2)) {
    scan2 = list_Car(scan);
    while (!list_Empty(scan2) &&
	   (!string_Equal(dfg_VarName(list_Car(scan2)), Name)))
      scan2 = list_Cdr(scan2);
    scan = list_Cdr(scan);
  }

  if (!list_Empty(scan2)) {
    /* Found variable */
    string_StringFree(Name);
    symbol = dfg_VarSymbol(list_Car(scan2));
  } else {
    /* Variable not found */
    if (dfg_VARDECL) {
      DFG_VAR newEntry = dfg_VarCreate();
      newEntry->name   = Name;
      newEntry->symbol = symbol_CreateStandardVariable();
      /* Add <newentry> to the first list in dfg_VARLIST */
      list_Rplaca(dfg_VARLIST, list_Cons(newEntry,list_Car(dfg_VARLIST)));
      symbol = dfg_VarSymbol(newEntry);
    } else {
      misc_StartUserErrorReport();
      misc_UserErrorReport("\n Line %u: Free Variable %s.\n", dfg_LINENUMBER, Name);
      misc_FinishUserErrorReport();
    }
  }
  return symbol;
}