forked from lydavid/CSC485-A2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathale.pl
14708 lines (13208 loc) · 626 KB
/
ale.pl
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
% ==============================================================================
% ALE -- Attribute Logic Engine
% ==============================================================================
% Version 4.0 --- alpha version
% Developed under: SICStus Prolog, Version 3.11.2
% Ported to SICStus Prolog, Version 4.0.7
% Authors:
% Bob Carpenter
% ---------------------------
% Alias I
% 181 N. 11th St., #401
% Brooklyn, NY 11211
% USA
%
% Gerald Penn
% --------------------------------
% Department of Computer Science
% University of Toronto
% 10 King's College Rd.
% Toronto M5S 3G4
% Canada
%
% Copyright 1992-1995, Bob Carpenter and Gerald Penn
% Copyright 1998,1999,2001--2006 Gerald Penn
% BUG FIX 12 JAN 1993 '|' changed to ',' in compile_body(!,.. -- Carpenter
% Extensional types added, using predicates from general constraint
% resolver - extensionality checked in rules before every edge assertion
% 1/26/93 - G. Penn
% Added iso/2, plus code for compiling extensionality check.
% 2/2/93 - G. Penn
% Bug corrected: extensionalise hung on cyclic feature structures.
% 2/15/93 - G. Penn
% Added inequations: checked in rules before edge insertion and after every
% recognised daughter description. Inequation checking partially compiled, in
% the manner of iso/2.
% 2/24/93 - G. Penn
% Added prolog-style inequation checking to procedural attachments.
% 2/25/93 - G. Penn
% Bug corrected: extensionalise did not handle feature structures with
% shared structures
% 2/26/93 - G. Penn
% Interpreter added
% 2/26/93 - G. Penn
% Inequation pruning added (at time of full dereferencing)
% 3/3/93 - G. Penn
% Bug corrected: daughters list for parse tree was reversed
% 3/4/93 - G. Penn
% Structure-sharing marked in mother, daughters, and inequations in
% interpreted mode. Break command uses prolog "break".
% 3/4/93 - G. Penn
% Bug corrected: reload did not load .extensional.pl
% 3/4/93 - G. Penn
% Bug corrected: interpreter did not assert edges with variable tags.
% 3/4/93 - G. Penn
% Bug corrected: edge/2 printed nothing in non-interpreted mode, and did not
% print inequations in interpreted mode.
% 3/6/93 - G. Penn
% Edge indices removed, and "trace" information incorporated into edge. In
% non-interpreted mode, extra information is uninstantiated. Edge/2 will not
% provide interpreter information for edges created while interpreter was
% inactive
% 3/6/93 - G. Penn
% Inequation data-structure converted from ineq(Tag1-SVs1,Tag2-SVs2,Rest) to
% ineq(Tag1,SVs1,Tag2,SVs2,Rest).
% 3/6/93 - G. Penn
% Bug corrected: extensionalise_list did not unify eligible structures from
% different FSs in the given list
% 3/6/93 - G. Penn
% Extensionalise and extensionalise_list now extensionalise a given list of
% inequations also (they don't check their consistency, however).
% 3/6/93 - G. Penn
% Bug corrected: nth_elt hung with input N <= 0.
% 3/12/93 - G. Penn
% Edges now indexed by a unique number, and daughters now stored by edge index.
% 3/12/93 - G. Penn
% General constraints added to types
% 3/17/93 - G. Penn
% Bug corrected: current_predicate needed to test existence of cons first in
% compile_cons
% 3/29/93 - G. Penn
% Bug corrected: ud did not unify IqsIn and Out when tags were identical
% 3/29/93 - G. Penn
% Bug corrected: inequations were threaded through negated predicates in
% compile_body
% 3/29/93 - G. Penn
% Bug corrected: quiet_interpreter mode not reset after parse is finished
% (now reset by build and by clear).
% 3/29/93 - G. Penn
% cats> category added. WARNING: Daughter indices not properly recorded for
% initial cats> elements.
% 4/5/93 - G. Penn
% =\= converted to unary operator with general descriptions. =@ added to
% dcs language.
% 4/7/93 - G. Penn
% Bug corrected: find_exts_list terminating condition had too many arguments
% 4/13/93 - G. Penn
% Bug corrected: duplicates_list was passed the wrong FS in add_to
% 4/14/93 - G. Penn
% Bug corrected: lexical items were fully dereferenced and pruned before
% lexical rules applied. Now, after.
% 4/17/93 - G. Penn
% Empty categories now undergo lexical rules.
% 4/17/93 - G. Penn
% Bug corrected: add_to(Type,... used cut to prevent false error messages, but
% also prevented backtracking to satisfy disjunctive constraints on Type.
% 4/17/93 - G. Penn
% Bug corrected: noadd option on query_edge_act did not have enough anonymous
% arguments
% 4/19/93 - G. Penn
% Bug corrected: compile_body included the code for =@ on the solve list
% rather than the prolog goal list.
% 4/19/93 - G. Penn
% Bug corrected: daughters of edges were not being printed with re-entrancy
% intact, since edges were recorded by index and recalled from memory as
% needed (which broke tag sharing). Daughters are now printed with accurate
% re-entrancy, although structure sharing between a daughter and a parent is
% not indicated still. Also, daughters of daughters, etc. are now available
% from any parent edge.
% 4/24/93 - G. Penn
% Bug corrected: in pp_vs(_unwritten), when no_write_feat_flag(F) was detected,
% the difference list for visited nodes was unlinked
% 4/24/93 - G. Penn
% Bug corrected: =\= had an operator precedence value higher than that of :,
% and both =\= and : had precedence values lower than ==.
% 5/2/93 - G. Penn
% Bug corrected: extensionalise hung on cyclic feature structures
% 7/20/93 - G. Penn
% general hooks to prolog added (of the form prolog(Goal)).
% 7/20/93 - G. Penn
% option added to suppress error messages from add_to - disjunctive type
% constraints can yield to many incompatible type messages before the
% appropriate disjunct is found. A check is also now made that every
% word with a lexical description has a lexical entry.
% 7/20/93 - G. Penn
% rec/1 flushes buffer after printing CATEGORY (to allow more accurate timing
% of rec/4).
% 7/20/93 - G. Penn
% disposed of unnecessary interpreter control code in interp.pl and renamed
% secret_interp to secret_verbose.
% 10/26/93 - G. Penn
% Suppressing adderrs now automatic for compile_lex. It remains an option
% for other top-level predicates which usse add_to. "Secret" versions of
% control predicates added.
% 10/26/93 - G. Penn
% Bug corrected: cons/2 and cons/3 were not declared as dynamic. Thus, the
% user could not use certain top-level predicates such as show_type and
% show_cons in signatures where no constraints existed.
% 10/26/93 - G. Penn
% Suppressing adderrs now automatic for compile_empty also.
% 11/20/93 - G. Penn
% Bug corrected: suppress_adderrs checks were not accompanied by fail.
% 11/23/93 - G. Penn
% dynamic no_interpreter added. Helps non-interpreted mode not to be
% impeded by interpreter code.
% 12/15/93 - G. Penn
% error message now given if extensional type in signature is not maximal.
% 12/15/93 - G. Penn
% Cuts switched from before retracts to after retracts where only one retract
% should be done since retract can succeed on backtracking (just to be safe -
% cuts in other predicates probably prevented any errors before).
% 1/4/94 - G. Penn
% =.. replaced by functor(... when only functor was needed.
% 3/19/94 - G. Penn
% Bug corrected: SVsOut = changed to SVsOut =.. in prune_deref
% 3/19/94 - G. Penn
% fully(TagOut) changed to fully(TagOut,SVsOut), so that prune_deref does
% not have to redereference the SVs-structure for TagOut.
% 3/19/94 - G. Penn
% Bug corrected: suppress_adderrs was not dynamically declared.
% 3/22/94 - G. Penn
% Bug corrected: missing ! in cats_member check for cats> [].
% 8/1/94 - G. Penn
% Bug corrected: maximality check always failed because every type subsumes
% itself. And I'm also really bummed out at the baseball strike that
% started today since it's the first time the Yankees have had a shot at the
% pennant in 13 years.
% 8/12/94 - G. Penn
% ----------------------------------------
% Ale 2.0.1 patches
% Hello message now says Version 2.0.1 instead of Beta.
% 12/22/94 - G. Penn
% match_list and match_list_rest error messages missing set of parentheses.
% 12/22/94 - G. Penn
% missing extensionalise_list definition added.
% 12/22/94 - G. Penn
% Compiler did not flush continuants before adding prolog hooks.
% NOTE - TAIL-RECURSIVE solve PLUS HOOKS LEADS TO UNEXPECTED BEHAVIOUR IN
% SOME CASES
% 12/23/94 - G. Penn
% Missing abolishes added to compiler code.
% 12/23/94 - G. Penn
% Empty appropriateness definition inserted when no features exist to
% avert SICStus existence error.
% 12/23/94 - G. Penn
% Missing cut added to compile_dtrs_rest in the final cats> clause.
% 12/23/94 - G. Penn
% 1/8/95 - Bob Carpenter
% Made Quintus compatible by bracketing if_h/1 and renaming append/3
% =====================================================================
% Errors Corrected 2.0.2
% =====================================================================
% 1/23/95 - Bob Carpenter
% Reported by Adam Przepiorkowski
% problem is that featval can be non-deterministic with constraints
% removed faulty cuts in add_to/5 to allow backtracking due to constraints
% also conditioned error message
% removed cut after featval/6 in 2nd clause of pathval/7
% conditioned error message
% =====================================================================
% ALE 2.0.2z
% =====================================================================
% atoms (# _) have been added as extensional types, subsumed by bottom,
% subsuming nothing, with no appropriate features, and no constraints.
% As a result, bottom must have no appropriate features or constraints.
% 11-17-95 - G. Penn
% check_sub_seq compiler modified to add fail predicate if there are no
% non_atomic extensional types. Before, it only added fail predicate if
% there were no extensional types. check_sub_seq is never used with
% atoms; and the main if_h check_sub_seq compiler clause depends on this
% fact.
% 12-26-95 - G. Penn
% atom functor changed from #/1 to a_/1. Because #/2 was already defined,
% there was a problem with getting prolog to recognize hashed predicates
% such as unify_type_#(X,Y,Z) as 'unify_type_#'(X,Y,Z) and not #(unify_type_,
% (X,Y,Z)). As a result, there can be no type called 'a_'.
% 12-26-95 - G. Penn
% =====================================================================
% Patches integrated from ALE 2.0.3
% =====================================================================
% Added reload/1 in order to load grammar source too (which needs to be there).
% 3/1/97 - G. Penn
% Added a clause for prolog hooks to satisfy_dtrs_goal/6 and pp_goal/4 so that
% top-level show clauses can display them.
% 3/1/97 - G. Penn
% Added deref_list/2 to deref before calls to extensionalise_list/2.
% Added deref calls before extensionalise calls in show_type/1, mgsat/1,
% query/1, macro/1, lex_rule/1, show_clause/1 and rule/1
% 3/1/97 - G. Penn
% Added extensionalisation check to compile_body just before =@ calls.
% 3/1/97 - G. Penn
% Added extensionalise/2 predicate for people to use inside hooks.
% 3/5/97 - G. Penn
% =====================================================================
% ALE 3.0
% =====================================================================
% 4/1/96 - Octav Popescu
% Changed compile_body/6 to take an extra argument that's used to compute the
% Goals list as a difference list
% Missing comma added to abolish(add_to_typcons,6) predicate in compile_gram/1.
% 4/5/96 - G. Penn
% 5/1/96 - Octav Popescu
% Added generator based on semantic head-driven generation algorithm
% (Shieber et al, 1990)
% 5/1/96 - Octav Popescu
% Added a test to check_inequal/2 for the case the inequations list is
% uninstantiated
% 5/1/96 - Octav Popescu
% Added test to compile_lex_rules/0 to signal lack of 'morphs' specification
% in a lexical rule
% 5/15/96 - Octav Popescu
% Added indexing and index compilation of the lexicon for generation
% 5/15/96 - Octav Popescu
% Changed to display the new version and add the banner to the version/0 message
% 7/15/96 - Octav Popescu
% Removed some ":" and added some " " to message errors to make them uniform
% Bug corrected: changed call to duplicates_list/8 from Args to
% ArgsOut in query/1 to take advantage of earlier dereferencing.
% 4/13/97 - G. Penn
% Added missing multiple_heads/1 and sem_head_member/1 definitions
% 5/5/97 - G. Penn
% Removed dynamic cons declarations (which are erased by abolish/2 anyway) and
% inserted current_predicate/2 declarations to protect top-level show
% predicates and compile-time error messages which call cons.
% 5/5/97 - G. Penn
% 5/5/97 - Octav Popescu
% Removed 'var' test from check_inequal/2 and prune/2 to allow for first
% argument indexing
% 5/7/97 - Octav Popescu
% Modified chained/6 and collect_entries/1 to avoid infinite loops generated by
% the lack of a 'var' test in check_inequal/2
% 6/2/97 - Octav Popescu
% Introduced sem_goal> tags
% 6/10/97 - Octav Popescu
% Added tests for wrongly placed sem_goal> tags
% Changed operator precedence of mgsat/1 to 1125 (from 1150).
% 6/14/97 - G. Penn
% maximal_defaults and bottom_defaults added: now if type is mentioned
% as subtype, or introduces features, but is not mentioned as super, assume
% sub [] (maximal_defaults); if type is mentioned as supertype, but not as
% subtype, assume bot sub (bottom_defaults).
% 6/15/97 - G. Penn
% intro is now autonomous. Only one of _ intro _ or _ sub _ intro _ is
% allowed per type.
% 6/15/97 - G. Penn
% subsumption testing added, with interpreter interface. Commands subtest
% and nosubtest toggle testing (run-time option and predicate).
% 6/15/97 - G. Penn
% functional constraints added to description language.
% 6/15/97 - G. Penn
% =@ flagged in type constraints. More compiler-time error messages added
% to compiler code.
% 6/15/97 - G. Penn
% Bug corrected: mgsat/1 tried to print description out after having added
% it to bottom - big trouble if it involved variables and created a cyclic
% feature structure.
% 6/15/97 - G. Penn
% Bug corrected: bottom_defaults should not add a default for atoms.
% 9/15/97 - G. Penn
% Added edge/1 to display edge by index.
% 9/16/97 - G. Penn
% Changed name of next option of query_edgeout/9 to continue, and of discard
% option of query_discard/10 to noadd. Added abort options to levels of
% interpreter that didn't have them. Changed query_proceed in edge/2 to fail.
% 9/17/97 - G. Penn
% setof's removed from maximal_defaults.
% 9/17/97 - G. Penn
% Bug corrected: T subs Ts did not behave correctly for uninstantiated T
% 9/17/97 - G. Penn
% Bug corrected: a_ X clauses in add_to_typeact and uact didn't bind reference
% tags correctly.
% 9/23/97 - G. Penn
% Bug corrected: homomorphism condition check modified to handle non-grounded
% atomic value restrictions.
% 9/23/97 - G. Penn
% Bug corrected: missing set of paren's in map_new_feats_introduced and
% map_new_feats_find resulting in an improper list for atoms.
% 9/23/97 - G. Penn
% Removed extra lex_rule abolish from compile_lex_rules.
% 9/24/97 - G. Penn
% Bug corrected: maximal_defaults wasn't looking in _ sub Ss intro _ for
% maximal members of Ss.
% 9/24/97 - G. Penn
% Bug corrected: pp_fs wasn't grounding VisOut for atoms
% 9/24/97 - G. Penn
% Added dynamic declaration for num/1.
% 9/25/97 - G. Penn
% Added abolish_preds/0.
% 9/25/97 - G. Penn
% Reordered type/1 clauses, cleaned up add_to's functional desc. handling,
% and removed several extraneous extensionality checks on atoms.
% 9/27/97 - G. Penn
% Bug corrected: current_predicate check added for if/2 in compile_cons.
% 9/27/97 - G. Penn
% Bug corrected: Ref added to visited list for atoms also.
% 9/27/97 - G. Penn
% Moved secret_noadderrs/0 call in compile_rules past multi-hashing of rule/6.
% 10/5/97 - G. Penn
% Added parse, generate, and parse_and_gen modes. Still only relative to one
% grammar. parse_and_gen is the default. Wrote ale_gen.pl and ale_parse.pl
% glue.
% 10/5/97 - G. Penn
% Bug corrected: parentheses misplaced when parsing/generating modes were
% added.
% 11/4/97 - G. Penn
% Added warning for ground atoms in appropriateness declarations.
% 11/4/97 - G. Penn
% Bug corrected: add_to/4 and compile_desc/6 had bad cut in inequation
% clause. Replaced with ->.
% 12/5/97 - G. Penn
% Modified edge_assert/8 and edge/2 to use rule-name and dtr info regardless
% of interpreter setting.
% 12/7/97 - G. Penn
% Stripped out version bannering - if you reload ALE, you get two banners.
% Also made parsing only the startup mode.
% 12/10/97 - G. Penn
% Rewrote match_list/11 so that initial cats> daughters are accessible through
% Dtrs list to the interpreter. Also involved adding an e_list check to
% compile_dtrs and compile_dtrs_rest that now requires goal_list_to_seq
% conversion.
% 12/10/97 - G. Penn
% Bug corrected: multi_hash on fsolve/5 must be done regardless of whether
% +++>/2 exists.
% 12/10/97 - G. Penn
% Bug corrected: fsolve/5, fun/1 and +++>/2 added to abolish_preds
% 12/10/97 - G. Penn
% Removed unused substring/4.
% 12/11/97 - G. Penn
% ALE now turns character_escapes off.
% 12/11/97 - G. Penn
% compile_iso and compile_check now called from inside compile_extensional.
% 2/1/98 - G. Penn
% Bug corrected: rewrote fsolve/5 (now fsolve/4) to compile further and
% avoid infinite loops in compile_fun/6.
% 2/1/98 - G. Penn
% Bug corrected: added fail-clause for solve/4 for when no if/2 statements are
% defined.
% 2/1/98 - G. Penn
% Bug corrected: moved compile_fun/0 to just after compile_sig - constraints
% must have access to fun/1.
% 2/1/98 - G. Penn
% Translated abolish/2 calls to abolish/1 ISO standard.
% 2/28/98 - G. Penn
% ======================================================================
% ALE 3.1
% ======================================================================
% Eliminated unused edge_dtrs/4 predicate
% 3/18/98 - G. Penn
% Switched order of edge index and left node for 1st-arg. indexing during
% parsing
% 3/18/98 - G. Penn
% Translated !; to ->; and if/3 wherever possible.
% 3/20/98 - G. Penn
% Bug corrected: misplaced cut in fun/1 clause of add_to/5
% 3/20/98 - G. Penn
% Bug corrected: misplaced cut in mh_arg/8
% 3/20/98 - G. Penn
% =.. replaced by functor/3 and arg/3 calls except where all args are needed.
% 3/20/98 - G. Penn
% Added missing compile_approp/1
% 3/21/98 - G. Penn
% Bug corrected: misplaced paren in compile_lex/0
% 3/21/98 - G. Penn
% Replaced intermediate files with term-expansion-based compiler.
% 3/21/98 - G. Penn
% Bug corrected: misplaced paren in compile_sub_type/2
% 3/21/98 - G. Penn
% Bug corrected: missing existential quantifier in setof/3 call of compile_fun
% 3/22/98 - G. Penn
% Bug corrected: removed redundant "lexical desc. for W is unsatisfiable" error
% 3/22/98 - G. Penn
% Rewrote lex/4 to use if/3.
% 3/24/98 - G. Penn
% Rearranged compiler code dependencies and abolish/1 calls, so that alec_throw
% compilation and abolish/1 of compiled predicates is performed as locally
% as possible. This restores incremental compilation predicates.
% 3/28/98 - G. Penn
% Changed alec_throw to '.alec_throw' and added touch/1 call to file-reading
% versions of compile-time predicates to ensure existence of '.alec_throw'
% 3/28/98 - G. Penn
% Added portray_message/1 hook to suppress .alec_throw compilation messages
% 3/28/98 - G. Penn
% Added "multiple constraint declaration error" to compile_cons_act/0.
% Added current_predicate check to compile_cons for when cons is not
% defined.
% 3/30/98 - G. Penn
% Converted ucons/7 and add_to_typecons/6 to compile-time predicates. Added
% ct/7 compilation in place of carrying around large list of TypeConsPairs.
% 3/30/98 - G. Penn
% Added 5-place and 6-place versions of ud/4 to build less structure on heap
% 4/5/98 - G. Penn
% Added 7-place version of compile_desc/6 to build less structure on heap.
% Also added 7-place version of compile_fun/6 and 8-place version of
% compile_pathval/7.
% 4/5/98 - G. Penn
% Changed fsolve/4 to fsolve/5 - split Ref and SVs to build less structure on
% heap
% 4/5/98 - G. Penn
% Eliminated :- true in compiled code, and first-arg indexed goal_list_to_seq
% 4/5/98 - G. Penn
% Replaced conc/3 with append/3 from library(lists).
% 4/9/98 - G. Penn
% Replaced make_seq/2 with goal_list_to_seq/2.
% 4/9/98 - G. Penn
% Disposed of unused make_list/2.
% 4/9/98 - G. Penn
% Replaced member/2, select/3, same_length/2, memberchk/2, reverse/2 with
% definitions from library(lists).
% 4/9/98 - G. Penn
% Replaced ord_union/3 with definition from library(ordsets).
% 4/9/98 - G. Penn
% Added new clause to add_to/5 and compile_desc/6,7 for fast unification of
% unbound variables
% 4/13/98 - G. Penn
% Added MGSat compilation for map_new_feats_find and map_new_feats_introduced,
% and for add_to_type and u when adding/unifying on one/two FSs with atomic
% types.
% 4/12/98 - G. Penn
% Changed add_to_typeact so that Type2 is first argument, in case we need
% to trap special cases of SVs.
% 4/13/98 - G. Penn
% Changed lexicon compilation from compiling to consulting. Also added more
% portray_message hooks to trap consulting messages.
% 4/15/98 - G. Penn
% Added lex_assert/0 and lex_compile/0 directives. Also added dynamic
% declaration in asserted case. Extended option's control to empty
% categories.
% 4/17/98 - G. Penn
% Added multifile declaration to asserted case for lex/4 and empty_cat/3
% compilation.
% 4/20/98 - G. Penn
% Created lex_act/6 predicate for lex/4 to call from term_expansion/2 hook for
% update_lex/1. Added update_lex/1 (which handles empty cats also),
% retract_lex/1, retractall_lex/1, retract_empty/0, and retractall_empty/0.
% 4/20/98 - G. Penn
% Bug corrected: generation code for cats> was calling subtype/2 instead of
% sub_type/2
% 6/15/98 - G. Penn
% Bug corrected: clause added to ct/7 for when cons/2 is not defined.
% 6/16/98 - G. Penn
% Switched order of number_display/2 clauses and added cut to handle variable
% first arguments (for interpreted generator)
% 6/18/98 - G. Penn
% Added export_words/2
% 6/23/98 - G. Penn
% Added rec/5 and rec/2 to enforce description on solution FS
% 6/23/98 - G. Penn
% Added rec_best/2, which produces all of the parses for the first list in a
% a list of lists of words that has any solutions that match an input Desc,
% rec_list/2, which produces all of the parses for every list in a
% list of lists of words, and rec_list/3, which is like rec_list/2 but
% collects solutions as fs(FS,Iqs) pairs in a list of lists.
% 6/23/98 - G. Penn
% ALE now turns character escapes on. Code generation modified to print
% '\+' and '=\=' correctly.
% 6/23/98 - G. Penn
% Moved approps(Type3,FRs3) call in uact/10 to just before map_feats_unif
% call - otherwise not needed.
% 6/24/98 - G. Penn
% Moved touch('.alec_throw') calls from compile_XYZ/1 predicates to
% compile_XYZ/0 predicates.
% 6/25/98 - G. Penn
% Added default maximal type specs for value restrictions and ext/1 types.
% 6/25/98 - G. Penn
% Removed extra space from "Compiling most general satisfiers..." message
% and "Compiling sub-types..." message
% 6/29/98 - G. Penn
% Bug corrected: rec_best/2's recursive call was to rec_list/2.
% 6/30/98 - G. Penn
% Added lex and gen prefix operators to match rec, query etc.
% 6/30/98 - G. Penn
% Added domain exception to edge/2 to enforce M=<N.
% 6/30/98 - G. Penn
% Moved mode-specific compilation messages inside parsing/generating checks.
% 6/30/98 - G. Penn
% Rewrote generator.
% 7/1/98 - G. Penn
% Changed name of lex(icon)_assert to lex(icon)_consult.
% 7/2/98 - G. Penn
% Bug corrected: macro calls could not backtrack in add_to because -> was
% used instead of if/3
% 7/7/98 - G. Penn
% Bug corrected: value restrictions from autonomous intro/2 declarations
% were not generating default maximal type specs. Line break also added
% at end of 'assuming' messages.
% 7/7/98 - G. Penn
% Bug corrected: a_ subtype/feature spec error did not check for autonomous
% intros. bot feature spec error did not check for autonomous intros.
% 7/16/98 - G. Penn
% Bug corrected: maximal_defaults was not filtering out a_/1 value restrictions
% or extensional types.
% 7/16/98 - G. Penn
% Bug corrected: turned off adderrs for enforcement of description argument of
% rec/2,5.
% 7/13/98 - G. Penn
% Bug corrected: missing clauses for =@ in pp_goal/4.
% 7/19/98 - G. Penn
% Bug corrected: missing clause for prolog hooks in mg_sat_goal/4
% 7/19/98 - G. Penn
% Bug corrected: several top-level predicates assumed atomic attached goals
% when collecting FS's to dereference. Now they use satisfy_dtrs_goal/6
% instead of mg_sat_goal/4.
% 7/19/98 - G. Penn
% Split chain_rule/8 and chained/4 into separate phases.
% 7/19/98 - G. Penn
% Removed abolish(generate/6) call from compile_grammar/1 - that is done in
% compile_grammar_act/0.
% 7/19/98 - G. Penn
% Changed non_chain_rule/8, chained/7 and chain_rule/12 to if_b to keep unification
% cases as first clauses after multi-hashing
% 7/19/98 - G. Penn
% Changed edge access to clause/2 calls - bypasses call stack.
% 7/20/98 - G. Penn
% Changed maximal_defaults so that 'assuming' message prints types w/o carriage
% returns. Modified bottom_defaults message to something parallel.
% 7/31/98 - G. Penn
% Changed carriage returns on if_warning messages.
% 7/31/98 - G. Penn
% Bug corrected: fast variable binding could leave SVs unbound in some
% disjunctive descriptions.
% 8/6/98 - G. Penn
% Bug corrected: clause/2 misspelled in subsumed/7
% 8/11/98 - G Penn
% ======================================================================
% ALE 3.2
% ======================================================================
% Renamed alec_catch_act/2 to alec_catch_hook/2.
% 9/7/98 - G. Penn
% Added multifile declaration for term_expansion/2 and alec_catch_hook/2.
% 9/7/98 - G. Penn
% Bug corrected: sub_type(Type,Type) clause was matching a_ atoms. Now use
% subs/2 directly, rather than type/2.
% 10/24/98 - G. Penn
% Added compile-time analysis of variable binding to eliminate var/1 shallow
% cuts in generated code where possible.
% 11/19/98 - G. Penn
% Added compile-time analysis of descriptions to eliminate fresh variable
% allocation in procedural calls where possible.
% 11/20/98 - G. Penn
% Removed solve/4 meta-interpreter. Clauses are now compiled into Prolog
% clauses with their names preceded by 'fs_'. Also added query_goal/4,
% query_goal/6 and pp_query_goal/4 for query/1 and gen_lex_close/9 to call,
% since there is no longer a close correspondence between preparing a goal
% for printing and preparing a goal for calling (actually, there never
% was - the printing prep. code did not work in some cases for calling
% prep.).
% 11/22/98 - G. Penn
% Bug corrected: (3.1.1) maximal_defaults added a sub_def entry for bot
% if it was used as an appropriate value restriction or as an extensional
% type.
% 11/22/98 - G. Penn
% Quiet interpreter mode removed. edge/8 always records daughters.
% 1/24/99 - G. Penn
% Cleaned up edge_assert/8 and pulled no_subsumption/0 check out to add_edge.
% 1/24/99 - G. Penn
% Added upward closure error message.
% 2/5/99 - G. Penn
% Added non-negative error message for edge/2
% 2/6/99 - G. Penn
% Bug corrected: node was unhooked in empty category indices - can be bound
% from Left arg. of rule/6.
% 3/6/99 - G. Penn
% Bug corrected: compile_desc/11 was binding its FS variable with Tag-SVs and
% inequational descriptions, which led to wasted structure on the heap.
% 3/6/99 - G. Penn
% Bug corrected: current_predicate check in empty_cat/7 needed to assert
% alec_closed_rules for rule compiler.
% 3/7/99 - G. Penn
% Implemented EFD-Closure parsing algorithm. Repairs ALE's problem with
% empty category combination, as well as with non-ISO compliance of SICStus
% (and probably SWI) with respect to asserted predicates. Tabulate FSs at
% compile-time to avoid Tag-SVs copying in compiled code. Cleaned up fresh
% argument binding and compile_desc/11's FS binding.
% 3/10/99 - G. Penn
% Implemented on-heap parsing to minimise edge copying.
% 3/10/99 - G. Penn
% Added FS palettes to avoid having to compile large FS's in compiled code.
% 3/11/99 - G. Penn
% Changed sub_type/2 and unify_type/3 compilation to consulting. Doing the
% same for approp/3 had net effect of slowing compilation down. System is
% slightly slower at run-time, presumably because of match_list list checks.
% 3/11/99 - G. Penn
% Modified on-heap chart to use custom edge/8 structures.
% 4/8/99 - G. Penn
% Removed unused member_ref_eq/2.
% 4/9/99 - G. Penn
% Bug corrected: FS palettes need to save inequation tags.
% 4/9/99 - G. Penn
% Rewrote extensionalisation code.
% 4/14/99 - G. Penn
% Bug corrected: query_goal/7 left Dtrs unbound on disjunctions.
% 4/20/99 - G. Penn
% Bug corrected: mg_sat_goal/5 left Iqs unbound on disjunctions.
% 4/20/99 - G. Penn
% Bug corrected: incorrect spacing for =@ in pp_goal/5.
% 4/20/99 - G. Penn
% Added shallow cuts.
% 4/21/99 - G. Penn
% Bug corrected: match_cat_to_next_cat/9 lost empty cat inequations with cats>
% 5/7/99 - G. Penn
% Bug corrected: non_chain_rule/8 code was being consulted.
% 5/8/99 - G. Penn
% Bug corrected: multi_hash/4 reversed order of clauses with same first-arg
% index by using accumulator in mh_arg/9. Changed to mh_arg/10 with diff.
% list to preserve order
% 5/9/99 - G. Penn
% Rewrote subsumption checking code.
% 5/20/99 - G. Penn
% Bug corrected: mh_arg was not capturing variable arguments before decomposing
% to match hashed argument position. Added nonvar/1 check.
% 5/21/99 - G. Penn
% Added two-place shallow cuts.
% 5/22/99 - G. Penn
% Bug corrected: cats> Dtrs were bound to rule Dtrs.
% 5/22/99 - G. Penn
% Bug corrected: changed order of all clauses matching shallow cut args so that
% they are matched before disjunctions.
% 5/22/99 - G. Penn
% Bug corrected: changed edge/2 to check for M<N, since it doesnt display
% empty cats. Also added no_interpreter check.
% 5/22/99 - G. Penn
% Bug corrected: empty/0 didnt print nl after '# of dtrs:' line, and dtr-#
% option didnt handle continue option properly.
% 5/22/99 - G. Penn
% Changed 't's to empty_assoc/1 calls.
% 5/23/99 - G. Penn
% Bug corrected: match_list_rest was not defined with a Chart argument.
% 5/23/99 - G. Penn
% Bug corrected: placed to_rebuild/1 lookup inside clause call
% 5/23/99 - G. Penn
% Changed compile_subsume to check first for parsing flag.
% 5/23/99 - G. Penn
% Bug corrected: show_type failed if there were constraints, but not on the
% type shown.
% 5/23/99 - G. Penn
% Added type/1 call to show_type so that it can iterate through types if
% uninstantiated.
% 5/23/99 - G. Penn
% (ALE 3.2.1) Updated for SICStus 3.8.6 - added discontiguous declarations
% and changed lexrule compilation to consulting because of 256-variable
% limit (always was there on paper, but now it's enforced!).
% 12/11/01 - G. Penn
% ======================================================================
% ALE 3.3
% ======================================================================
% Changed deref/3 and deref/4 to allow for delaying (pp_fs and fully_deref
% bind Tag). Eliminated now redundant deref_pp/3.
% 2/23/02 - G. Penn
% Removed Dups thread from duplicates/8 - reference tag itself keeps track
% of this. Also replaced Vis thread in both duplicates_ and pp_ predicates
% with assoc lists, and unwound duplicates_list/6 calls that created their
% own list structures. Added Ref/SVs versions of FS predicates; changed
% pp_fs(...Col) to pp_fs_col to avoid arity conflicts.
% 2/23/02 - G. Penn
% added when_type/3, when_approp/4, when_eq/3, compile_cond/6 and a
% compile_body/7 clause for delaying.
% 2/7/99 - G. Penn
% Bug corrected: trigger variables must be embedded in a shallow-cut to trivally
% succeed, not fail, when the other disjunct is chosen
% 2/9/99 - G. Penn
% Bug corrected: when_approp/3 was passing an unbound variable to the compiler as
% the body goal rather than a call/1 predicate. The compiler filled this in with
% true.
% 2/9/99 - G. Penn
% Bug corrected: query_goal/4,6 were not stripping prolog/1 wrapper off hooks
% in executable Goal.
% 3/16/02 - G. Penn
% Modified when_eq/3 so that unification can bind tags without instantiating.
% 3/17/02 - G. Penn
% Changed @=/2 compilation to use compile_descs_fresh/12.
% 3/24/02 - G. Penn
% Added support for built-in =/2 (necessary for complex antecedent constraints).
% 4/29/02 - G. Penn
% Bug corrected: empty_cat/7, fsolve/5, lex/4, and non_chain_rule/8 were using
% current_predicate/2 to test for success rather than existence, and were undefined
% instead of simply producing failure when user code they relied on did not exist.
% 4/29/02 - G. Penn
% Bug corrected: Rewrote immed_cons/3 and show_cons/2 to display procedural attachments
% on constraints.
% 4/29/02 - G. Penn
% Bug corrected: duplicates_fs/5 must erase a reference from the Visited AVL before it
% instantiates it, or else the AVL's order-invariant could be thrown off and other
% elements become irretrievable.
% 5/1/02 - G. Penn
% Added print-hooks (portray_fs/10), and changed duplicate marking from reference
% instantiation to a parallel AVL tree.
% 5/3/02 - G. Penn
%
% Bug corrected: query_goal/6 (now 7) was not handling narrowly quantified variables