1Moscow ML version 2.01a (January 2004)
2Enter `quit();' to quit.
3- linking values
4OK: a
5OK: b
6OK: c
7OK: d
8OK: e
9OK: f
10OK: g
11OK: h
12OK: i
13OK: j
14OK: k
15OK: l
16open A
17OK:  a
18OK:  b
19OK:  c
20OK:  d
21OK:  e
22OK:  f
23OK:  g
24OK:  h
25OK:  i
26OK:  j
27OK:  k
28OK:  l
29local open A
30OK: a
31OK: b
32OK: c
33OK: d
34OK: e
35OK: f
36OK: g
37OK: h
38OK: i
39OK: j
40OK: k
41OK: llinking structures
42OK: a
43OK: b
44OK: c
45OK: d
46OK: e
47OK: f
48OK: g
49OK: h
50OK: i
51OK: j
52OK: k
53OK: l
54open A
55OK: a
56OK: b
57OK: c
58OK: d
59OK: e
60OK: f
61OK: g
62OK: h
63OK: i
64OK: j
65OK: k
66OK: l
67local open A
68OK: a
69OK: b
70OK: c
71OK: d
72OK: e
73OK: f
74OK: g
75OK: h
76OK: i
77OK: j
78OK: k
79OK: llinking functors
80OK: a
81OK: b
82OK: c
83OK: d
84OK: e
85OK: f
86OK: g
87OK: h
88OK: i
89OK: j
90OK: k
91OK: l
92open A
93OK: a
94OK: b
95OK: c
96OK: d
97OK: e
98OK: f
99OK: g
100OK: h
101OK: i
102OK: j
103OK: k
104OK: l
105local open A in
106OK:  a
107OK:  b
108OK:  c
109OK:  d
110OK:  e
111OK:  f
112OK:  g
113OK:  h
114OK:  i
115OK:  j
116OK:  k
117OK:  l
118open A B X
119value OK: X.a
120value OK: B.b
121value OK: X.x
122value OK: B.y
123structure OK: X.a
124structure OK: B.b
125structure OK: X.x
126structure OK: B.y
127functor OK: X.a
128functor OK: B.b
129functor OK: X.x
130functor OK: B.y
131local open A Y.B X
132value OK: X.a
133value OK: B.b
134value OK: X.x
135value OK: B.y
136structure OK: X.a
137structure OK: B.b
138structure OK: X.x
139structure OK: B.y
140functor OK: X.a
141functor OK: B.b
142functor OK: X.x
143functor OK: B.y
144open B A X
145value OK: X.a
146value OK: b
147value OK: X.x
148value OK: B.y
149structure OK: X.a
150structure OK: b
151structure OK: X.x
152structure OK: B.y
153functor OK: X.a
154functor OK: b
155functor OK: X.x
156functor OK: B.y
157local open B A X
158value OK: X.a
159value OK: b
160value OK: X.x
161value OK: B.y
162structure OK: X.a
163structure OK: b
164structure OK: X.x
165structure OK: B.y
166functor OK: X.a
167functor OK: b
168functor OK: X.x
169functor OK: B.y
170open B X A
171value OK: a
172value OK: b
173value OK: X.x
174value OK: B.y
175structure OK: a
176structure OK: b
177structure OK: X.x
178structure OK: B.y
179functor OK: a
180functor OK: b
181functor OK: X.x
182functor OK: B.y
183local open B X A
184value OK: a
185value OK: b
186value OK: X.x
187value OK: B.y
188structure OK: a
189structure OK: b
190structure OK: X.x
191structure OK: B.y
192functor OK: a
193functor OK: b
194functor OK: X.x
195functor OK: B.y
196open A X B
197value OK: B.a
198value OK: B.b
199value OK: X.x
200value OK: B.y
201structure OK: B.a
202structure OK: B.b
203structure OK: X.x
204structure OK: B.y
205functor OK: B.a
206functor OK: B.b
207functor OK: X.x
208functor OK: B.y
209local open A X B
210value OK: B.a
211value OK: B.b
212value OK: X.x
213value OK: B.y
214structure OK: B.a
215structure OK: B.b
216structure OK: X.x
217structure OK: B.y
218functor OK: B.a
219functor OK: B.b
220functor OK: X.x
221functor OK: B.y
222open X A B
223value OK: B.a
224value OK: B.b
225value OK: X.x
226value OK: B.y
227structure OK: B.a
228structure OK: B.b
229structure OK: X.x
230structure OK: B.y
231functor OK: B.a
232functor OK: B.b
233functor OK: X.x
234functor OK: B.y
235local open X A B
236value OK: B.a
237value OK: B.b
238value OK: X.x
239value OK: B.y
240structure OK: B.a
241structure OK: B.b
242structure OK: X.x
243structure OK: B.y
244functor OK: B.a
245functor OK: B.b
246functor OK: X.x
247functor OK: B.y
248open X B A
249value OK: a
250value OK: b
251value OK: X.x
252value OK: B.y
253structure OK: a
254structure OK: b
255structure OK: X.x
256structure OK: B.y
257functor OK: a
258functor OK: b
259functor OK: X.x
260functor OK: B.y
261local open X B A
262value OK: a
263value OK: b
264value OK: X.x
265value OK: B.y
266structure OK: a
267structure OK: b
268structure OK: X.x
269structure OK: B.y
270functor OK: a
271functor OK: b
272functor OK: X.x
273functor OK: B.y-
274-
275Moscow ML version 2.01a (January 2004)
276Enter `quit();' to quit.
277- > structure A :
278  {structure a : {val v : string},
279   structure b : {val v : string},
280   structure c : {val v : string},
281   structure d : {val v : string},
282   structure e : {val v : string},
283   structure f : {val v : string},
284   structure g : {val v : string},
285   structure h : {val v : string},
286   structure i : {val v : string},
287   structure j : {val v : string},
288   structure k : {val v : string},
289   structure l : {val v : string},
290   functor a : {}->{val v : string},
291   functor b : {}->{val v : string},
292   functor c : {}->{val v : string},
293   functor d : {}->{val v : string},
294   functor e : {}->{val v : string},
295   functor f : {}->{val v : string},
296   functor g : {}->{val v : string},
297   functor h : {}->{val v : string},
298   functor i : {}->{val v : string},
299   functor j : {}->{val v : string},
300   functor k : {}->{val v : string},
301   functor l : {}->{val v : string},
302   val a : string,
303   val b : string,
304   val c : string,
305   val d : string,
306   val e : string,
307   val f : string,
308   val g : string,
309   val h : string,
310   val i : string,
311   val j : string,
312   val k : string,
313   val l : string}
314- > structure Y :
315  {structure A1 :
316     {structure a : {val v : string},
317      structure b : {val v : string},
318      structure c : {val v : string},
319      structure d : {val v : string},
320      structure e : {val v : string},
321      structure f : {val v : string},
322      structure g : {val v : string},
323      structure h : {val v : string},
324      structure i : {val v : string},
325      structure j : {val v : string},
326      structure k : {val v : string},
327      structure l : {val v : string},
328      functor a : {}->{val v : string},
329      functor b : {}->{val v : string},
330      functor c : {}->{val v : string},
331      functor d : {}->{val v : string},
332      functor e : {}->{val v : string},
333      functor f : {}->{val v : string},
334      functor g : {}->{val v : string},
335      functor h : {}->{val v : string},
336      functor i : {}->{val v : string},
337      functor j : {}->{val v : string},
338      functor k : {}->{val v : string},
339      functor l : {}->{val v : string},
340      val a : string,
341      val b : string,
342      val c : string,
343      val d : string,
344      val e : string,
345      val f : string,
346      val g : string,
347      val h : string,
348      val i : string,
349      val j : string,
350      val k : string,
351      val l : string},
352   structure B :
353     {structure a : {val v : string},
354      structure b : {val v : string},
355      structure y : {val v : string},
356      functor a : {}->{val v : string},
357      functor b : {}->{val v : string},
358      functor y : {}->{val v : string},
359      val a : string,
360      val b : string,
361      val y : string},
362   structure C1 :
363     {structure a : {val v : string},
364      structure b : {val v : string},
365      structure c : {val v : string},
366      structure d : {val v : string},
367      structure e : {val v : string},
368      structure f : {val v : string},
369      structure g : {val v : string},
370      structure h : {val v : string},
371      structure i : {val v : string},
372      structure j : {val v : string},
373      structure k : {val v : string},
374      structure l : {val v : string},
375      functor a : {}->{val v : string},
376      functor b : {}->{val v : string},
377      functor c : {}->{val v : string},
378      functor d : {}->{val v : string},
379      functor e : {}->{val v : string},
380      functor f : {}->{val v : string},
381      functor g : {}->{val v : string},
382      functor h : {}->{val v : string},
383      functor i : {}->{val v : string},
384      functor j : {}->{val v : string},
385      functor k : {}->{val v : string},
386      functor l : {}->{val v : string},
387      val a : string,
388      val b : string,
389      val c : string,
390      val d : string,
391      val e : string,
392      val f : string,
393      val g : string,
394      val h : string,
395      val i : string,
396      val j : string,
397      val k : string,
398      val l : string},
399   structure D1 :
400     {structure a : {val v : string},
401      structure b : {val v : string},
402      structure c : {val v : string},
403      structure d : {val v : string},
404      structure e : {val v : string},
405      structure f : {val v : string},
406      structure g : {val v : string},
407      structure h : {val v : string},
408      structure i : {val v : string},
409      structure j : {val v : string},
410      structure k : {val v : string},
411      structure l : {val v : string},
412      functor a : {}->{val v : string},
413      functor b : {}->{val v : string},
414      functor c : {}->{val v : string},
415      functor d : {}->{val v : string},
416      functor e : {}->{val v : string},
417      functor f : {}->{val v : string},
418      functor g : {}->{val v : string},
419      functor h : {}->{val v : string},
420      functor i : {}->{val v : string},
421      functor j : {}->{val v : string},
422      functor k : {}->{val v : string},
423      functor l : {}->{val v : string},
424      val a : string,
425      val b : string,
426      val c : string,
427      val d : string,
428      val e : string,
429      val f : string,
430      val g : string,
431      val h : string,
432      val i : string,
433      val j : string,
434      val k : string,
435      val l : string},
436   functor A1 : {}->{},
437   val a : string}
438- linking values- > val check = fn : string -> string -> unit
439-
440OK: a-
441OK: b-
442OK: c-
443OK: d-
444OK: e-
445OK: f-
446OK: g-
447OK: h-
448OK: i-
449OK: j-
450OK: k-
451OK: l-
452open A
453OK: a
454OK: b
455OK: c
456OK: d
457OK: e
458OK: f
459OK: g
460OK: h
461OK: i
462OK: j
463OK: k
464OK: l-
465local open A
466OK: a
467OK: b
468OK: c
469OK: d
470OK: e
471OK: f
472OK: g
473OK: h
474OK: i
475OK: j
476OK: k
477OK: l- linking structures
478OK: a
479OK: b
480OK: c
481OK: d
482OK: e
483OK: f
484OK: g
485OK: h
486OK: i
487OK: j
488OK: k
489OK: l-
490open A
491OK: a
492OK: b
493OK: c
494OK: d
495OK: e
496OK: f
497OK: g
498OK: h
499OK: i
500OK: j
501OK: k
502OK: l-
503local open A
504OK: a
505OK: b
506OK: c
507OK: d
508OK: e
509OK: f
510OK: g
511OK: h
512OK: i
513OK: j
514OK: k
515OK: l- linking functors
516OK: a
517OK: b
518OK: c
519OK: d
520OK: e
521OK: f
522OK: g
523OK: h
524OK: i
525OK: j
526OK: k
527OK: l-
528open A
529OK: a
530OK: b
531OK: c
532OK: d
533OK: e
534OK: f
535OK: g
536OK: h
537OK: i
538OK: j
539OK: k
540OK: l-
541local open A in
542OK: a
543OK: b
544OK: c
545OK: d
546OK: e
547OK: f
548OK: g
549OK: h
550OK: i
551OK: j
552OK: k
553OK: l- > structure X :
554  {structure a : {val v : string},
555   structure x : {val v : string},
556   functor a : {}->{val v : string},
557   functor x : {}->{val v : string},
558   val a : string,
559   val x : string}
560  val check = fn : string -> string -> string -> unit
561-
562open A B X
563value OK: X.a
564value OK: B.b
565value OK: X.x
566value OK: B.y
567structure OK: X.a
568structure OK: B.b
569structure OK: X.x
570structure OK: B.y
571functor OK: X.a
572functor OK: B.b
573functor OK: X.x
574functor OK: B.y-
575local open A Y.B X
576value OK: X.a
577value OK: B.b
578value OK: X.x
579value OK: B.y
580structure OK: X.a
581structure OK: B.b
582structure OK: X.x
583structure OK: B.y
584functor OK: X.a
585functor OK: B.b
586functor OK: X.x
587functor OK: B.y-
588open B A X
589value OK: X.a
590value OK: b
591value OK: X.x
592value OK: B.y
593structure OK: X.a
594structure OK: b
595structure OK: X.x
596structure OK: B.y
597functor OK: X.a
598functor OK: b
599functor OK: X.x
600functor OK: B.y-
601local open B A X
602value OK: X.a
603value OK: b
604value OK: X.x
605value OK: B.y
606structure OK: X.a
607structure OK: b
608structure OK: X.x
609structure OK: B.y
610functor OK: X.a
611functor OK: b
612functor OK: X.x
613functor OK: B.y-
614open B X A
615value OK: a
616value OK: b
617value OK: X.x
618value OK: B.y
619structure OK: a
620structure OK: b
621structure OK: X.x
622structure OK: B.y
623functor OK: a
624functor OK: b
625functor OK: X.x
626functor OK: B.y
627local open B X A
628value OK: a
629value OK: b
630value OK: X.x
631value OK: B.y
632structure OK: a
633structure OK: b
634structure OK: X.x
635structure OK: B.y
636functor OK: a
637functor OK: b
638functor OK: X.x
639functor OK: B.y-
640open A X B
641value OK: B.a
642value OK: B.b
643value OK: X.x
644value OK: B.y
645structure OK: B.a
646structure OK: B.b
647structure OK: X.x
648structure OK: B.y
649functor OK: B.a
650functor OK: B.b
651functor OK: X.x
652functor OK: B.y-
653local open A X B
654value OK: B.a
655value OK: B.b
656value OK: X.x
657value OK: B.y
658structure OK: B.a
659structure OK: B.b
660structure OK: X.x
661structure OK: B.y
662functor OK: B.a
663functor OK: B.b
664functor OK: X.x
665functor OK: B.y-
666open X A B
667value OK: B.a
668value OK: B.b
669value OK: X.x
670value OK: B.y
671structure OK: B.a
672structure OK: B.b
673structure OK: X.x
674structure OK: B.y
675functor OK: B.a
676functor OK: B.b
677functor OK: X.x
678functor OK: B.y-
679local open X A B
680value OK: B.a
681value OK: B.b
682value OK: X.x
683value OK: B.y
684structure OK: B.a
685structure OK: B.b
686structure OK: X.x
687structure OK: B.y
688functor OK: B.a
689functor OK: B.b
690functor OK: X.x
691functor OK: B.y-
692open X B A
693value OK: a
694value OK: b
695value OK: X.x
696value OK: B.y
697structure OK: a
698structure OK: b
699structure OK: X.x
700structure OK: B.y
701functor OK: a
702functor OK: b
703functor OK: X.x
704functor OK: B.y-
705local open X B A
706value OK: a
707value OK: b
708value OK: X.x
709value OK: B.y
710structure OK: a
711structure OK: b
712structure OK: X.x
713structure OK: B.y
714functor OK: a
715functor OK: b
716functor OK: X.x
717functor OK: B.y-
718-
719Moscow ML version 2.01a (January 2004)
720Enter `quit();' to quit.
721- > val it = () : unit
722- > val it = () : unit
723- > val it = () : unit
724- > val it = () : unit
725- > val it = () : unit
726- linking values
727OK: a
728OK: b
729OK: c
730OK: d
731OK: e
732OK: f
733OK: g
734OK: h
735OK: i
736OK: j
737OK: k
738OK: l
739open A
740OK: a
741OK: b
742OK: c
743OK: d
744OK: e
745OK: f
746OK: g
747OK: h
748OK: i
749OK: j
750OK: k
751OK: l
752local open A
753OK: a
754OK: b
755OK: c
756OK: d
757OK: e
758OK: f
759OK: g
760OK: h
761OK: i
762OK: j
763OK: k
764OK: llinking structures
765OK: a
766OK: b
767OK: c
768OK: d
769OK: e
770OK: f
771OK: g
772OK: h
773OK: i
774OK: j
775OK: k
776OK: l
777open A
778OK: a
779OK: b
780OK: c
781OK: d
782OK: e
783OK: f
784OK: g
785OK: h
786OK: i
787OK: j
788OK: k
789OK: l
790local open A
791OK: a
792OK: b
793OK: c
794OK: d
795OK: e
796OK: f
797OK: g
798OK: h
799OK: i
800OK: j
801OK: k
802OK: llinking functors
803OK: a
804OK: b
805OK: c
806OK: d
807OK: e
808OK: f
809OK: g
810OK: h
811OK: i
812OK: j
813OK: k
814OK: l
815open A
816OK: a
817OK: b
818OK: c
819OK: d
820OK: e
821OK: f
822OK: g
823OK: h
824OK: i
825OK: j
826OK: k
827OK: l
828local open A in
829OK: a
830OK: b
831OK: c
832OK: d
833OK: e
834OK: f
835OK: g
836OK: h
837OK: i
838OK: j
839OK: k
840OK: l
841 open A B X
842value OK: X.a
843value OK: B.b
844value OK: X.x
845value OK: B.y
846structure OK: X.a
847structure OK: B.b
848structure OK: X.x
849structure OK: B.y
850functor OK: X.a
851functor OK: B.b
852functor OK: X.x
853functor OK: B.y
854local open A B X
855value OK: X.a
856value OK: B.b
857value OK: X.x
858value OK: B.y
859structure OK: X.a
860structure OK: B.b
861structure OK: X.x
862structure OK: B.y
863functor OK: X.a
864functor OK: B.b
865functor OK: X.x
866functor OK: B.y
867open B A X
868value OK: X.a
869value OK: b
870value OK: X.x
871value OK: B.y
872structure OK: X.a
873structure OK: b
874structure OK: X.x
875structure OK: B.y
876functor OK: X.a
877functor OK: b
878functor OK: X.x
879functor OK: B.y
880local open B A X
881value OK: X.a
882value OK: b
883value OK: X.x
884value OK: B.y
885structure OK: X.a
886structure OK: b
887structure OK: X.x
888structure OK: B.y
889functor OK: X.a
890functor OK: b
891functor OK: X.x
892functor OK: B.y
893open B X A
894value OK: a
895value OK: b
896value OK: X.x
897value OK: B.y
898structure OK: a
899structure OK: b
900structure OK: X.x
901structure OK: B.y
902functor OK: a
903functor OK: b
904functor OK: X.x
905functor OK: B.y
906local open B X A
907value OK: a
908value OK: b
909value OK: X.x
910value OK: B.y
911structure OK: a
912structure OK: b
913structure OK: X.x
914structure OK: B.y
915functor OK: a
916functor OK: b
917functor OK: X.x
918functor OK: B.y
919open A X B
920value OK: B.a
921value OK: B.b
922value OK: X.x
923value OK: B.y
924structure OK: B.a
925structure OK: B.b
926structure OK: X.x
927structure OK: B.y
928functor OK: B.a
929functor OK: B.b
930functor OK: X.x
931functor OK: B.y
932local open A X B
933value OK: B.a
934value OK: B.b
935value OK: X.x
936value OK: B.y
937structure OK: B.a
938structure OK: B.b
939structure OK: X.x
940structure OK: B.y
941functor OK: B.a
942functor OK: B.b
943functor OK: X.x
944functor OK: B.y
945open X A B
946value OK: B.a
947value OK: B.b
948value OK: X.x
949value OK: B.y
950structure OK: B.a
951structure OK: B.b
952structure OK: X.x
953structure OK: B.y
954functor OK: B.a
955functor OK: B.b
956functor OK: X.x
957functor OK: B.y
958local open X A B
959value OK: B.a
960value OK: B.b
961value OK: X.x
962value OK: B.y
963structure OK: B.a
964structure OK: B.b
965structure OK: X.x
966structure OK: B.y
967functor OK: B.a
968functor OK: B.b
969functor OK: X.x
970functor OK: B.y
971open X B A
972value OK: a
973value OK: b
974value OK: X.x
975value OK: B.y
976structure OK: a
977structure OK: b
978structure OK: X.x
979structure OK: B.y
980functor OK: a
981functor OK: b
982functor OK: X.x
983functor OK: B.y
984local open X B A
985value OK: a
986value OK: b
987value OK: X.x
988value OK: B.y
989structure OK: a
990structure OK: b
991structure OK: X.x
992structure OK: B.y
993functor OK: a
994functor OK: b
995functor OK: X.x
996functor OK: B.y
997> val it = () : unit
998-
999Moscow ML version 2.01a (January 2004)
1000Enter `quit();' to quit.
1001- > signature Array =
1002  /\array.
1003    {type 'a array = 'a array,
1004     val 'a init : 'a -> 'a array,
1005     val 'a sub : 'a array -> int -> 'a,
1006     val 'a update : 'a array -> int -> 'a -> 'a array}
1007- > structure ArrayZero :
1008  {type 'a array = 'a,
1009   val 'a init : 'a -> 'a,
1010   val ('a, 'b) sub : 'a -> 'b -> 'a,
1011   val ('a, 'b, 'c) update : 'a -> 'b -> 'c -> 'c}
1012- > functor ArraySucc :
1013  !array.
1014   {type 'a array = 'a array,
1015    val 'a init : 'a -> 'a array,
1016    val 'a sub : 'a array -> int -> 'a,
1017    val 'a update : 'a array -> int -> 'a -> 'a array}->
1018       {type 'a array = 'a array * 'a array,
1019        val 'a init : 'a -> 'a array * 'a array,
1020        val 'a sub : 'a array * 'a array -> int -> 'a,
1021        val 'a update :
1022          'a array * 'a array -> int -> 'a -> 'a array * 'a array}
1023- > val mkArray = fn :
1024  int ->
1025  [?array.
1026    {type 'a array = 'a array,
1027     val 'a init : 'a -> 'a array,
1028     val 'a sub : 'a array -> int -> 'a,
1029     val 'a update : 'a array -> int -> 'a -> 'a array}]
1030- > val two = fn : int -> int
1031- > val n = 10 : int
1032- > val max = 1024 : int
1033- > val 'a iter = fn : ('a -> int -> 'a) -> 'a -> int -> 'a
1034- > New type names: array
1035  structure A :
1036  {type 'a array = 'a array,
1037   val 'a init : 'a -> 'a array,
1038   val 'a sub : 'a array -> int -> 'a,
1039   val 'a update : 'a array -> int -> 'a -> 'a array}
1040- > val a = <array> : int array
1041- > val test1 = "OK" : string
1042- > val a = <array> : int array
1043- > val l =
1044    [1024, 1023, 1022, 1021, 1020, 1019, 1018, 1017, 1016, 1015, 1014, 1013,
1045     1012, 1011, 1010, 1009, 1008, 1007, 1006, 1005, 1004, 1003, 1002, 1001,
1046     1000, 999, 998, 997, 996, 995, 994, 993, 992, 991, 990, 989, 988, 987,
1047     986, 985, 984, 983, 982, 981, 980, 979, 978, 977, 976, 975, 974, 973, 972,
1048     971, 970, 969, 968, 967, 966, 965, 964, 963, 962, 961, 960, 959, 958, 957,
1049     956, 955, 954, 953, 952, 951, 950, 949, 948, 947, 946, 945, 944, 943, 942,
1050     941, 940, 939, 938, 937, 936, 935, 934, 933, 932, 931, 930, 929, 928, 927,
1051     926, 925, 924, 923, 922, 921, 920, 919, 918, 917, 916, 915, 914, 913, 912,
1052     911, 910, 909, 908, 907, 906, 905, 904, 903, 902, 901, 900, 899, 898, 897,
1053     896, 895, 894, 893, 892, 891, 890, 889, 888, 887, 886, 885, 884, 883, 882,
1054     881, 880, 879, 878, 877, 876, 875, 874, 873, 872, 871, 870, 869, 868, 867,
1055     866, 865, 864, 863, 862, 861, 860, 859, 858, 857, 856, 855, 854, 853, 852,
1056     851, 850, 849, 848, 847, 846, 845, 844, 843, 842, 841, 840, 839, 838, 837,
1057     836, 835, 834, 833, 832, 831, 830, 829, 828, 827, 826, 825, ...] :
1058  int list
1059  val test2 = "OK" : string
1060-
1061Moscow ML version 2.01a (January 2004)
1062Enter `quit();' to quit.
1063- > signature Array =
1064  /\array.
1065    {type 'a array = 'a array,
1066     val 'a init : 'a -> 'a array,
1067     val 'a update : 'a array -> int -> 'a -> 'a array,
1068     val 'a sub : 'a array -> int -> 'a}
1069- > structure ArrayZero :
1070  {type 'a array = 'a,
1071   val 'a init : 'a -> 'a,
1072   val ('a, 'b) sub : 'a -> 'b -> 'a,
1073   val ('a, 'b, 'c) update : 'a -> 'b -> 'c -> 'c}
1074- > functor ArraySucc :
1075  !array.
1076   {type 'a array = 'a array,
1077    val 'a init : 'a -> 'a array,
1078    val 'a update : 'a array -> int -> 'a -> 'a array,
1079    val 'a sub : 'a array -> int -> 'a}->
1080       {type 'a array = 'a array * 'a array,
1081        val 'a init : 'a -> 'a array * 'a array,
1082        val 'a sub : 'a array * 'a array -> int -> 'a,
1083        val 'a update :
1084          'a array * 'a array -> int -> 'a -> 'a array * 'a array}
1085- > val mkArray = fn :
1086  int ->
1087  [?array.
1088    {type 'a array = 'a array,
1089     val 'a init : 'a -> 'a array,
1090     val 'a update : 'a array -> int -> 'a -> 'a array,
1091     val 'a sub : 'a array -> int -> 'a}]
1092- > val two = fn : int -> int
1093- > val n = 10 : int
1094- > val max = 1024 : int
1095- > val 'a iter = fn : ('a -> int -> 'a) -> 'a -> int -> 'a
1096- > New type names: array
1097  structure A :
1098  {type 'a array = 'a array,
1099   val 'a init : 'a -> 'a array,
1100   val 'a sub : 'a array -> int -> 'a,
1101   val 'a update : 'a array -> int -> 'a -> 'a array}
1102- > val a = <array> : int array
1103- > val test1 = "OK" : string
1104- > val a = <array> : int array
1105- > val l =
1106    [1024, 1023, 1022, 1021, 1020, 1019, 1018, 1017, 1016, 1015, 1014, 1013,
1107     1012, 1011, 1010, 1009, 1008, 1007, 1006, 1005, 1004, 1003, 1002, 1001,
1108     1000, 999, 998, 997, 996, 995, 994, 993, 992, 991, 990, 989, 988, 987,
1109     986, 985, 984, 983, 982, 981, 980, 979, 978, 977, 976, 975, 974, 973, 972,
1110     971, 970, 969, 968, 967, 966, 965, 964, 963, 962, 961, 960, 959, 958, 957,
1111     956, 955, 954, 953, 952, 951, 950, 949, 948, 947, 946, 945, 944, 943, 942,
1112     941, 940, 939, 938, 937, 936, 935, 934, 933, 932, 931, 930, 929, 928, 927,
1113     926, 925, 924, 923, 922, 921, 920, 919, 918, 917, 916, 915, 914, 913, 912,
1114     911, 910, 909, 908, 907, 906, 905, 904, 903, 902, 901, 900, 899, 898, 897,
1115     896, 895, 894, 893, 892, 891, 890, 889, 888, 887, 886, 885, 884, 883, 882,
1116     881, 880, 879, 878, 877, 876, 875, 874, 873, 872, 871, 870, 869, 868, 867,
1117     866, 865, 864, 863, 862, 861, 860, 859, 858, 857, 856, 855, 854, 853, 852,
1118     851, 850, 849, 848, 847, 846, 845, 844, 843, 842, 841, 840, 839, 838, 837,
1119     836, 835, 834, 833, 832, 831, 830, 829, 828, 827, 826, 825, ...] :
1120  int list
1121  val test2 = "OK" : string
1122-
1123Moscow ML version 2.01a (January 2004)
1124Enter `quit();' to quit.
1125- > val divides = fn : int -> int -> bool
1126- > val succ = fn : int -> int
1127- > signature Stream =
1128  /\state.
1129    {type state = state,
1130     val start : state,
1131     val next : state -> state,
1132     val value : state -> int}
1133- > val sift = fn :
1134  [?state.
1135    {type state = state,
1136     val start : state,
1137     val next : state -> state,
1138     val value : state -> int}] ->
1139  [?state.
1140    {type state = state,
1141     val start : state,
1142     val next : state -> state,
1143     val value : state -> int}]
1144- > New type names: state
1145  structure Sieve :
1146  {type state = state,
1147   val next : state -> state,
1148   val start : state,
1149   val value : state -> int}
1150- > val nthstate = fn : int -> state
1151- > val nthprime = fn : int -> int
1152- > val primes = fn : int -> int list
1153- > structure StratSieve :
1154  {structure Start :
1155     {type state = int,
1156      val next : int -> int,
1157      val start : int,
1158      val 'a value : 'a -> 'a},
1159   functor Next :
1160     !state/1.
1161      {type state = state/1,
1162       val start : state/1,
1163       val next : state/1 -> state/1,
1164       val value : state/1 -> int}->
1165          {type state = state/1,
1166           val divisor : int,
1167           val filter : state/1 -> state/1,
1168           val next : state/1 -> state/1,
1169           val start : state/1,
1170           val value : state/1 -> int},
1171   functor Value :
1172     !state/1.
1173      {type state = state/1,
1174       val start : state/1,
1175       val next : state/1 -> state/1,
1176       val value : state/1 -> int}->{val value : int}}
1177- > val hundred_primes =
1178    [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
1179     71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149,
1180     151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
1181     233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313,
1182     317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
1183     419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499,
1184     503, 509, 521, 523, 541] : int list
1185- > val test = "OK" : string
1186-
1187Moscow ML version 2.01a (January 2004)
1188Enter `quit();' to quit.
1189- > signature POLY =
1190  /\nat.
1191    {structure Nat :
1192       {type nat = nat,
1193        val z : nat,
1194        val s : nat -> nat,
1195        val 'a i : 'a -> ('a -> 'a) -> nat -> 'a},
1196     val eval : nat -> nat list -> nat}
1197- > functor MkPoly :
1198  !nat.
1199   {type nat = nat,
1200    val z : nat,
1201    val s : nat -> nat,
1202    val 'a i : 'a -> ('a -> 'a) -> nat -> 'a}->
1203       ({type nat = nat,
1204         val z : nat,
1205         val s : nat -> nat,
1206         val 'a i : 'a -> ('a -> 'a) -> nat -> 'a}->
1207            {val add : nat -> nat -> nat})->
1208           ({type nat = nat,
1209             val z : nat,
1210             val s : nat -> nat,
1211             val 'a i : 'a -> ('a -> 'a) -> nat -> 'a}->
1212                ({type nat = nat,
1213                  val z : nat,
1214                  val s : nat -> nat,
1215                  val 'a i : 'a -> ('a -> 'a) -> nat -> 'a}->
1216                     {val add : nat -> nat -> nat})->
1217                    {val mult : nat -> nat -> nat})->
1218               {structure Add : {val add : nat -> nat -> nat},
1219                structure Mult : {val mult : nat -> nat -> nat},
1220                structure Nat :
1221                  {type nat = nat,
1222                   val 'a i : 'a -> ('a -> 'a) -> nat -> 'a,
1223                   val s : nat -> nat,
1224                   val z : nat},
1225                val eval : nat -> nat list -> nat}
1226- > structure Nat :
1227  {type nat = int,
1228   val 'a i : 'a -> ('a -> 'a) -> int -> 'a,
1229   val s : int -> int,
1230   val z : int}
1231- > structure N :
1232  {type nat = int,
1233   val 'a i : 'a -> ('a -> 'a) -> int -> 'a,
1234   val s : int -> int,
1235   val z : int}
1236- > functor A :
1237  {type nat = int,
1238   val z : int,
1239   val s : int -> int,
1240   val 'a i : 'a -> ('a -> 'a) -> int -> 'a}->{val add : int -> int -> int}
1241- > functor M :
1242  {type nat = int,
1243   val z : int,
1244   val s : int -> int,
1245   val 'a i : 'a -> ('a -> 'a) -> int -> 'a}->
1246      ({type nat = int,
1247        val z : int,
1248        val s : int -> int,
1249        val 'a i : 'a -> ('a -> 'a) -> int -> 'a}->
1250           {val add : int -> int -> int})->
1251          {structure Add : {val add : int -> int -> int},
1252           val mult : int -> int -> int}
1253- > structure Poly :
1254  {structure Add : {val add : int -> int -> int},
1255   structure Mult : {val mult : int -> int -> int},
1256   structure Nat :
1257     {type nat = int,
1258      val 'a i : 'a -> ('a -> 'a) -> int -> 'a,
1259      val s : int -> int,
1260      val z : int},
1261   val eval : int -> int list -> int}
1262- > val test = 10 : int
1263- > functor A' :
1264  !nat.
1265   {type nat = nat,
1266    val s : nat -> nat,
1267    val i : nat -> (nat -> nat) -> nat -> nat}->
1268       {val add : nat -> nat -> nat, val sum : nat -> nat list -> nat}
1269- > structure Poly' :
1270  {structure Add : {val add : int -> int -> int},
1271   structure Mult : {val mult : int -> int -> int},
1272   structure Nat :
1273     {type nat = int,
1274      val 'a i : 'a -> ('a -> 'a) -> int -> 'a,
1275      val s : int -> int,
1276      val z : int},
1277   val eval : int -> int list -> int}
1278- > structure N :
1279  {type nat = int,
1280   val 'a i : 'a -> ('a -> 'a) -> int -> 'a,
1281   val s : int -> int,
1282   val z : int}
1283- > functor A : {}->{val add : int -> int -> int}
1284- > functor M :
1285  {}->
1286      ({type nat = int,
1287        val z : int,
1288        val s : int -> int,
1289        val 'a i : 'a -> ('a -> 'a) -> int -> 'a}->{})->
1290          {val mult : int -> int -> int}
1291- > structure IntPoly :
1292  {structure Add : {val add : int -> int -> int},
1293   structure Mult : {val mult : int -> int -> int},
1294   structure Nat :
1295     {type nat = int,
1296      val 'a i : 'a -> ('a -> 'a) -> int -> 'a,
1297      val s : int -> int,
1298      val z : int},
1299   val eval : int -> int list -> int}
1300- > val test = 10 : int
1301- > New type names: nat
1302  structure FastNat :
1303  {structure N :
1304     {type nat = nat,
1305      val 'a i : 'a -> ('a -> 'a) -> nat -> 'a,
1306      val s : nat -> nat,
1307      val z : nat},
1308   functor A : {}->{val add : nat -> nat -> nat},
1309   functor M :
1310     {}->
1311         ({type nat = nat,
1312           val z : nat,
1313           val s : nat -> nat,
1314           val 'a i : 'a -> ('a -> 'a) -> nat -> 'a}->{})->
1315             {val mult : nat -> nat -> nat}}
1316- > structure FastPoly :
1317  {structure Add : {val add : nat -> nat -> nat},
1318   structure Mult : {val mult : nat -> nat -> nat},
1319   structure Nat :
1320     {type nat = nat,
1321      val 'a i : 'a -> ('a -> 'a) -> nat -> 'a,
1322      val s : nat -> nat,
1323      val z : nat},
1324   val eval : nat -> nat list -> nat}
1325-
1326Moscow ML version 2.01a (January 2004)
1327Enter `quit();' to quit.
1328- > functor F : {val a : unit}->{val b : unit}->{val c : unit}->{}
1329- > structure A : {val a : unit}
1330  structure B : {val b : unit}
1331  structure C : {val c : unit}
1332- > functor F : {val a : unit}->{val b : unit}->{val c : unit}->{}
1333- > functor FA : {val b : unit}->{val c : unit}->{}
1334- > functor FAB : {val c : unit}->{}
1335- > structure FABC : {}
1336- > functor H : ({}->{})->{}->{}
1337- > structure X : {}
1338- > signature A = /\a.{type a = a, val a : a}
1339- > signature B = /\b.{type b = b, val b : b}
1340- > signature C = /\c.{type c = c, val c : c}
1341- > functor X : !a.{type a = a, val a : a}->{type a = a, val a : a}
1342- > functor X : !a.{type a = a, val a : a}->?a/1.{type a = a/1, val a : a/1}
1343- > functor X : !a.{type a = a, val a : a}->?a/1.{type a = a/1, val a : a/1}
1344- > functor X :
1345  !a.
1346   {type a = a, val a : a}->
1347       !b.
1348        {type b = b, val b : b}->
1349            !c.{type c = c, val c : c}->{type a = a, val a : a}
1350- > functor X :
1351  !a.
1352   {type a = a, val a : a}->
1353       !b.
1354        {type b = b, val b : b}->
1355            !c.{type c = c, val c : c}->?a/1.{type a = a/1, val a : a/1}
1356- > functor X :
1357  !a.
1358   {type a = a, val a : a}->
1359       !b.
1360        {type b = b, val b : b}->
1361            !c.{type c = c, val c : c}->?a/1.{type a = a/1, val a : a/1}
1362- > signature F = !a.{type a = a, val a : a}->?b.{type b = b, val b : b}
1363- > signature G =
1364  (!a.{type a = a, val a : a}->?b.{type b = b, val b : b})->
1365      ?c.{type c = c, val c : c}
1366- > signature H =
1367  ((!a.{type a = a, val a : a}->?b.{type b = b, val b : b})->
1368       ?c.{type c = c, val c : c})->
1369      (!a.{type a = a, val a : a}->?b.{type b = b, val b : b})->
1370          ?c.{type c = c, val c : c}
1371- > structure A : {type a = int, val a : int}
1372- > structure B : {type b = int, val b : int}
1373- > structure C : {type c = int, val c : int}
1374- > functor F : !a.{type a = a, val a : a}->{type b = int, val b : int}
1375- > structure FA : {type b = int, val b : int}
1376- > functor G :
1377  (!a.{type a = a, val a : a}->?b.{type b = b, val b : b})->
1378      ?b.{type c = int, val c : int}
1379- > New type names: b
1380  structure GF : {type c = int, val c : int}
1381- > functor F : {}->{}
1382- > structure FA : {}
1383- > functor F : !a.{type a = a, val a : a}->{}
1384- > structure FA : {}
1385- > functor F : !a.{type a = a, val a : a}->{}
1386- > structure FA : {}
1387- > signature A = /\a.{type a = a, val a : a}
1388- > signature B = /\b/1.{type b = b/1, val b : b/1}
1389- > signature C = /\c.{type c = c, val c : c}
1390- > signature S =
1391  {functor F1 : !a.{type a = a, val a : a}->?b/1.{type b = b/1, val b : b/1},
1392   functor F2 : !a.{type a = a, val a : a}->?b/1.{type b = b/1, val b : b/1},
1393   functor F3 :
1394     !a.
1395      {type a = a, val a : a}->
1396          !b/1.{type b = b/1, val b : b/1}->?c.{type c = c, val c : c}}
1397- > signature F = !t.{type t = t}->{}
1398- > signature F = /\u.{}->{type u = u}
1399- > signature F = /\u.!t.{type t = t}->{type u = (u t)}
1400- > New type names: =u, =v
1401  functor F :
1402  !t w x.
1403   {type t = t, type w = w, type x = x}->
1404       {datatype u = ((u t w x),{con C : (u t w x)}),
1405        datatype v = ((v t w x),{con D : (v t w x)}),
1406        con C : (u t w x),
1407        con D : (v t w x)}
1408- > New type names: =u/1, =v/1
1409  functor F :
1410  !t w x.
1411   {type t = t, type w = w, type x = x}->
1412       {datatype 'a u = ('a (u/1 t w x),{con 'a C : 'a -> 'a (u/1 t w x)}),
1413        datatype 'a v = ('a (v/1 t w x),{con 'b D : 'b -> 'b (v/1 t w x)}),
1414        con 'a C : 'a -> 'a (u/1 t w x),
1415        con 'b D : 'b -> 'b (v/1 t w x)}
1416-
1417Moscow ML version 2.01a (January 2004)
1418Enter `quit();' to quit.
1419- > functor ok :
1420  !u.(!t.{type t = t}->{type u = (u t)})->!t.{type t = t}->?u/1.{type u = u/1}
1421- ! Toplevel input:
1422!     op F:functor X:sig type t end -> sig type u end;
1423!     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1424! Signature mismatch: the module does not match the signature ...
1425! Scope Violation: type constructor u of the range has specification:
1426!   type u = (u t)
1427! in the signature
1428! but is implemented by the declaration:
1429!   type u = u/1
1430! in the module
1431! The declaration violates the specification because
1432! the type constructor u/1 is a parameter
1433! that is declared within the scope of u.
1434- > signature S = /\u.!w.{type w = w, type t = w}->{type u = (u w)}
1435- > functor F : !w.{type w = w, type t = w}->{type u = w * w}
1436- > functor G : !w.{type w = w, type t = w}->{type u = int * int}
1437- ! Toplevel input:
1438! functor Fail = (functor (X:sig type t  end) => struct datatype u = C of X.t * X.t end):S;
1439!                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1440! Signature mismatch: the module does not match the signature ...
1441! Scope Violation: type constructor u of the range has specification:
1442!   type u = (u w)
1443! in the signature
1444! but is implemented by the declaration:
1445!   datatype u = (u/1,{con C : w * w -> u/1})
1446! in the module
1447! The declaration violates the specification because
1448! the type constructor u/1 is a parameter
1449! that is declared within the scope of u.
1450- > New type names: u
1451  functor F :
1452  !t.
1453   {type t = t, val x : t}->
1454       {datatype u = ((u t),{con C : t -> (u t), con D : (u t) -> (u t)}),
1455        con C : t -> (u t),
1456        con D : (u t) -> (u t),
1457        val y : (u t),
1458        val z : (u t)}
1459- > structure X :
1460  {datatype u =
1461     ((u string),
1462      {con C : string -> (u string), con D : (u string) -> (u string)}),
1463   con C : string -> (u string),
1464   con D : (u string) -> (u string),
1465   val y : (u string),
1466   val z : (u string)}
1467- > datatype u =
1468  ((u string),{con C : string -> (u string), con D : (u string) -> (u string)})
1469  con C = fn : string -> (u string)
1470  con D = fn : (u string) -> (u string)
1471  val y = C "x" : (u string)
1472  val z = D(C "x") : (u string)
1473- > New type names: u/1
1474  functor F :
1475  !s t.
1476   {type s = s, val w : s, type t = t, val x : t}->
1477       {datatype u =
1478          ((u/1 s t),
1479           {con C : s * t -> (u/1 s t), con D : (u/1 s t) -> (u/1 s t)}),
1480        con C : s * t -> (u/1 s t),
1481        con D : (u/1 s t) -> (u/1 s t),
1482        val y : (u/1 s t),
1483        val z : (u/1 s t)}
1484- > structure X :
1485  {datatype u =
1486     ((u/1 bool string),
1487      {con C : bool * string -> (u/1 bool string),
1488       con D : (u/1 bool string) -> (u/1 bool string)}),
1489   con C : bool * string -> (u/1 bool string),
1490   con D : (u/1 bool string) -> (u/1 bool string),
1491   val y : (u/1 bool string),
1492   val z : (u/1 bool string)}
1493- > datatype u =
1494  ((u/1 bool string),
1495   {con C : bool * string -> (u/1 bool string),
1496    con D : (u/1 bool string) -> (u/1 bool string)})
1497  con C = fn : bool * string -> (u/1 bool string)
1498  con D = fn : (u/1 bool string) -> (u/1 bool string)
1499  val y = C(true, "x") : (u/1 bool string)
1500  val z = D(C(true, "x")) : (u/1 bool string)
1501- > New type names: u/2
1502  functor F :
1503  !s t.
1504   {type s = s, val w : s, type t = t, val x : t}->
1505       {datatype 'a u =
1506          ('a (u/2 s t),
1507           {con 'a C : s * t * 'a -> 'a (u/2 s t),
1508            con 'a D : ('a * 'a) (u/2 s t) -> 'a (u/2 s t)}),
1509        con 'a C : s * t * 'a -> 'a (u/2 s t),
1510        con 'a D : ('a * 'a) (u/2 s t) -> 'a (u/2 s t),
1511        val y : int (u/2 s t),
1512        val z : int (u/2 s t)}
1513- > structure X :
1514  {datatype 'a u =
1515     ('a (u/2 bool string),
1516      {con 'a C : bool * string * 'a -> 'a (u/2 bool string),
1517       con 'a D : ('a * 'a) (u/2 bool string) -> 'a (u/2 bool string)}),
1518   con 'a C : bool * string * 'a -> 'a (u/2 bool string),
1519   con 'a D : ('a * 'a) (u/2 bool string) -> 'a (u/2 bool string),
1520   val y : int (u/2 bool string),
1521   val z : int (u/2 bool string)}
1522- > datatype 'a u =
1523  ('a (u/2 bool string),
1524   {con 'a C : bool * string * 'a -> 'a (u/2 bool string),
1525    con 'a D : ('a * 'a) (u/2 bool string) -> 'a (u/2 bool string)})
1526  con 'a C = fn : bool * string * 'a -> 'a (u/2 bool string)
1527  con 'a D = fn : ('a * 'a) (u/2 bool string) -> 'a (u/2 bool string)
1528  val y = C(true, "x", 1) : int (u/2 bool string)
1529  val z = D(C(true, "x", (1, 1))) : int (u/2 bool string)
1530- > New type names: u/3
1531  functor A :
1532  !a b.
1533   {type a = a, type b = b, val a : a, val b : b}->
1534       {datatype u = ((u/3 a b),{con C : a * b -> (u/3 a b)}),
1535        con C : a * b -> (u/3 a b),
1536        val y : (u/3 a b)}
1537- > structure A :
1538  {datatype u = ((u/3 int bool),{con C : int * bool -> (u/3 int bool)}),
1539   con C : int * bool -> (u/3 int bool),
1540   val y : (u/3 int bool)}
1541- > datatype u = ((u/3 int bool),{con C : int * bool -> (u/3 int bool)})
1542  con C = fn : int * bool -> (u/3 int bool)
1543  val y = C(1, false) : (u/3 int bool)
1544- > New type names: u/4, v, =w, x
1545  functor A :
1546  !a b c.
1547   {type a = a,
1548    type b = b,
1549    type 'a c = 'a c,
1550    val 'a a : a,
1551    val 'a b : b,
1552    val 'a f : 'a -> 'a c}->
1553       {datatype u = ((u/4 a b c),{con C : a * b -> (u/4 a b c)}),
1554        datatype v =
1555          ((v a b c),
1556           {con B : (v a b c), con D : a * b * (v a b c) -> (v a b c)}),
1557        datatype 'a w =
1558          ('a (w a b c),
1559           {con 'a B : 'a -> 'a (w a b c),
1560            con 'a D : ('a * 'a) (w a b c) -> 'a (w a b c)}),
1561        datatype 'a x =
1562          ('a (x a b c),
1563           {con 'a B : 'a -> 'a (x a b c),
1564            con 'a D : 'a c (x a b c) -> 'a (x a b c)}),
1565        con 'a B : 'a -> 'a (x a b c),
1566        con C : a * b -> (u/4 a b c),
1567        con 'a D : 'a c (x a b c) -> 'a (x a b c),
1568        val u : (u/4 a b c),
1569        val v : (v a b c),
1570        val w : (a * b) (w a b c),
1571        val x : (a * b) (x a b c)}
1572- > structure A :
1573  {datatype u =
1574     ((u/4 int bool (/\'a.{l : 'a, r : 'a})),
1575      {con C : int * bool -> (u/4 int bool (/\'a.{l : 'a, r : 'a}))}),
1576   datatype v =
1577     ((v int bool (/\'a.{l : 'a, r : 'a})),
1578      {con B : (v int bool (/\'a.{l : 'a, r : 'a})),
1579       con D :
1580         int * bool * (v int bool (/\'a.{l : 'a, r : 'a})) ->
1581         (v int bool (/\'a.{l : 'a, r : 'a}))}),
1582   datatype 'a w =
1583     ('a (w int bool (/\'a'.{l : 'a', r : 'a'})),
1584      {con 'a B : 'a -> 'a (w int bool (/\'a'.{l : 'a', r : 'a'})),
1585       con 'a D :
1586         ('a * 'a) (w int bool (/\'a'.{l : 'a', r : 'a'})) ->
1587         'a (w int bool (/\'a'.{l : 'a', r : 'a'}))}),
1588   datatype 'a x =
1589     ('a (x int bool (/\'a'.{l : 'a', r : 'a'})),
1590      {con 'a B : 'a -> 'a (x int bool (/\'a'.{l : 'a', r : 'a'})),
1591       con 'a D :
1592         {l : 'a, r : 'a} (x int bool (/\'a'.{l : 'a', r : 'a'})) ->
1593         'a (x int bool (/\'a'.{l : 'a', r : 'a'}))}),
1594   con 'a B : 'a -> 'a (x int bool (/\'a'.{l : 'a', r : 'a'})),
1595   con C : int * bool -> (u/4 int bool (/\'a.{l : 'a, r : 'a})),
1596   con 'a D :
1597     {l : 'a, r : 'a} (x int bool (/\'a'.{l : 'a', r : 'a'})) ->
1598     'a (x int bool (/\'a'.{l : 'a', r : 'a'})),
1599   val u : (u/4 int bool (/\'a.{l : 'a, r : 'a})),
1600   val v : (v int bool (/\'a.{l : 'a, r : 'a})),
1601   val w : (int * bool) (w int bool (/\'a.{l : 'a, r : 'a})),
1602   val x : (int * bool) (x int bool (/\'a.{l : 'a, r : 'a}))}
1603- > datatype u =
1604  ((u/4 int bool (/\'a.{l : 'a, r : 'a})),
1605   {con C : int * bool -> (u/4 int bool (/\'a.{l : 'a, r : 'a}))})
1606  datatype v =
1607  ((v int bool (/\'a.{l : 'a, r : 'a})),
1608   {con B : (v int bool (/\'a.{l : 'a, r : 'a})),
1609    con D :
1610      int * bool * (v int bool (/\'a.{l : 'a, r : 'a})) ->
1611      (v int bool (/\'a.{l : 'a, r : 'a}))})
1612  datatype 'a w =
1613  ('a (w int bool (/\'a'.{l : 'a', r : 'a'})),
1614   {con 'a B : 'a -> 'a (w int bool (/\'a'.{l : 'a', r : 'a'})),
1615    con 'a D :
1616      ('a * 'a) (w int bool (/\'a'.{l : 'a', r : 'a'})) ->
1617      'a (w int bool (/\'a'.{l : 'a', r : 'a'}))})
1618  datatype 'a x =
1619  ('a (x int bool (/\'a'.{l : 'a', r : 'a'})),
1620   {con 'a B : 'a -> 'a (x int bool (/\'a'.{l : 'a', r : 'a'})),
1621    con 'a D :
1622      {l : 'a, r : 'a} (x int bool (/\'a'.{l : 'a', r : 'a'})) ->
1623      'a (x int bool (/\'a'.{l : 'a', r : 'a'}))})
1624  con 'a B = fn : 'a -> 'a (x int bool (/\'a'.{l : 'a', r : 'a'}))
1625  con C = fn : int * bool -> (u/4 int bool (/\'a.{l : 'a, r : 'a}))
1626  con 'a D = fn :
1627  {l : 'a, r : 'a} (x int bool (/\'a'.{l : 'a', r : 'a'})) ->
1628  'a (x int bool (/\'a'.{l : 'a', r : 'a'}))
1629  val u = C(1, false) : (u/4 int bool (/\'a.{l : 'a, r : 'a}))
1630  val v = D(1, false, D(1, false, D(1, false, B))) :
1631  (v int bool (/\'a.{l : 'a, r : 'a}))
1632  val w = D(B((1, false), (1, false))) :
1633  (int * bool) (w int bool (/\'a.{l : 'a, r : 'a}))
1634  val x = D(B{l = (1, false), r = (1, false)}) :
1635  (int * bool) (x int bool (/\'a.{l : 'a, r : 'a}))
1636-
1637Moscow ML version 2.01a (January 2004)
1638Enter `quit();' to quit.
1639- > structure A :
1640  {structure B : {val b : bool, val c : string},
1641   type t = int,
1642   val a : int,
1643   val 'a d : 'a list,
1644   exn e : exn}
1645- > type u = int
1646- > type u = int
1647- > New type names: =v
1648  functor A : {}->{datatype v = (v,{con C : v}), con C : v}
1649- > type u = v
1650- > datatype u = (v,{con C : v})
1651  con C = C : v
1652- ! Toplevel input:
1653! type fail = X.t where X = struct type v = int datatype t = C of t end;
1654!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1655! Illegal projection: this projection causes an existential type constructor to escape its scope
1656- ! Toplevel input:
1657! type fail = X.v where X = struct datatype t = C of t type v = t end;
1658!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1659! Illegal projection: this projection causes an existential type constructor to escape its scope
1660- > functor G : {}->?=v/1.{datatype v = (v/1,{con C : v/1}), con C : v/1}
1661- ! Toplevel input:
1662! type fail = X.v where X = G();
1663!             ^^^^^^^^^^^^^^^^^
1664! Illegal projection: this projection causes an existential type constructor to escape its scope
1665-
1666Moscow ML version 2.01a (January 2004)
1667Enter `quit();' to quit.
1668- > signature Collection =
1669  /\e t.{type e = e, type t = t, val empty : t, val add : e -> t -> t}
1670- > functor Set :
1671  !e.
1672   {type e = e, val ord : e * e -> bool}->
1673       ?t.{type e = e, type t = t, val add : e -> t -> t, val empty : t}
1674- > New type names: t
1675  structure IncSet :
1676  {type e = int, type t = t, val add : int -> t -> t, val empty : t}
1677- > New type names: t/1
1678  structure DecSet :
1679  {type e = int, type t = t/1, val add : int -> t/1 -> t/1, val empty : t/1}
1680- ! Toplevel input:
1681! val fail =  DecSet.add 2 (IncSet.add 1 IncSet.empty);
1682!                           ^^^^^^^^^^^^^^^^^^^^^^^^^
1683! Type clash: expression of type
1684!   t
1685! cannot have type
1686!   t/1
1687- > New type names: t/2
1688  functor List :
1689  !e.
1690   {type e = e}->
1691       {type e = e,
1692        type t = (t/2 e),
1693        val add : e -> (t/2 e) -> (t/2 e),
1694        val empty : (t/2 e)}
1695- > structure IncList :
1696  {type e = int,
1697   type t = (t/2 int),
1698   val add : int -> (t/2 int) -> (t/2 int),
1699   val empty : (t/2 int)}
1700- > structure DecList :
1701  {type e = int,
1702   type t = (t/2 int),
1703   val add : int -> (t/2 int) -> (t/2 int),
1704   val empty : (t/2 int)}
1705- > val ok = <t/2 int> : (t/2 int)
1706- > structure BoolList :
1707  {type e = bool,
1708   type t = (t/2 bool),
1709   val add : bool -> (t/2 bool) -> (t/2 bool),
1710   val empty : (t/2 bool)}
1711- ! Toplevel input:
1712! val fail = BoolList.add true (IncList.add 1 IncList.empty);
1713!                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1714! Type clash: expression of type
1715!   (t/2 int)
1716! cannot have type
1717!   (t/2 bool)
1718-
1719Moscow ML version 2.01a (January 2004)
1720Enter `quit();' to quit.
1721- > structure X : {type 'a r = 'a ref}
1722- > type 'a r = 'a ref
1723- > structure Y : {type 'a r = 'a ref}
1724- > structure Z : {type 'a r = 'a ref}
1725  type 'a r = 'a ref
1726-
1727Moscow ML version 2.01a (January 2004)
1728Enter `quit();' to quit.
1729- > New type names: =u
1730  structure A :
1731  {datatype u = ((u unit),{con C : unit ref -> (u unit)}),
1732   con C : unit ref -> (u unit)}
1733  functor F :
1734  !t.
1735   {type t = t}->
1736       {datatype u = ((u t),{con C : t ref -> (u t)}), con C : t ref -> (u t)}
1737- > val ok = fn : (u unit) * (u unit) -> bool
1738- > structure B :
1739  {datatype u =
1740     ((u (unit -> unit)),{con C : (unit -> unit) ref -> (u (unit -> unit))}),
1741   con C : (unit -> unit) ref -> (u (unit -> unit))}
1742- > val ok = fn : (u (unit -> unit)) * (u (unit -> unit)) -> bool
1743- > New type names: u/1
1744  functor G :
1745  !t.
1746   {type t = t}->
1747       {datatype u = ((u/1 t),{con C : t -> (u/1 t)}), con C : t -> (u/1 t)}
1748- > structure C :
1749  {datatype u = ((u/1 unit),{con C : unit -> (u/1 unit)}),
1750   con C : unit -> (u/1 unit)}
1751- ! Toplevel input:
1752! val fail = op = : C.u * C.u -> bool;
1753!            ^^^^
1754! Type clash: expression of type
1755!   ''a * ''a -> bool
1756! cannot have type
1757!   (u/1 unit) * (u/1 unit) -> bool
1758- > structure D :
1759  {datatype u =
1760     ((u/1 (unit -> unit)),{con C : (unit -> unit) -> (u/1 (unit -> unit))}),
1761   con C : (unit -> unit) -> (u/1 (unit -> unit))}
1762- ! Toplevel input:
1763! val fail = op = : D.u * D.u -> bool;
1764!            ^^^^
1765! Type clash: expression of type
1766!   ''a * ''a -> bool
1767! cannot have type
1768!   (u/1 (unit -> unit)) * (u/1 (unit -> unit)) -> bool
1769- > New type names: =u/2
1770  functor H :
1771  !=t.
1772   {type t = t}->
1773       {datatype u = ((u/2 t),{con C : t -> (u/2 t)}), con C : t -> (u/2 t)}
1774- > structure E :
1775  {datatype u = ((u/2 unit),{con C : unit -> (u/2 unit)}),
1776   con C : unit -> (u/2 unit)}
1777- > val ok = fn : (u/2 unit) * (u/2 unit) -> bool
1778- > New type names: =u/3
1779  functor I :
1780  !s =t.
1781   {type s = s, type t = t}->
1782       {datatype u = ((u/3 s t),{con C : t -> (u/3 s t)}),
1783        con C : t -> (u/3 s t)}
1784- > structure F :
1785  {datatype u = ((u/3 unit unit),{con C : unit -> (u/3 unit unit)}),
1786   con C : unit -> (u/3 unit unit)}
1787- > val ok = fn : (u/3 unit unit) * (u/3 unit unit) -> bool
1788- > structure G :
1789  {datatype u =
1790     ((u/3 (unit -> unit) unit),{con C : unit -> (u/3 (unit -> unit) unit)}),
1791   con C : unit -> (u/3 (unit -> unit) unit)}
1792- > val ok = fn : (u/3 (unit -> unit) unit) * (u/3 (unit -> unit) unit) -> bool
1793- > functor ok :
1794  !=u/4.
1795   (!t.{type t = t}->{type u = (u/4 t)})->!t.{type t = t}->{type u = (u/4 t)}
1796- > functor ok :
1797  !=u/4.
1798   (!t.{type t = t}->{type u = (u/4 t)})->!=t.{type t = t}->{type u = (u/4 t)}
1799- > functor ok :
1800  !=u/4.
1801   (!t.{type t = t}->{type u = (u/4 t)})->!t.{type t = t}->{type u = (u/4 t)}
1802- > functor ok :
1803  !=u/4.
1804   (!t.{type t = t}->{type u = (u/4 t)})->!=t.{type t = t}->{type u = (u/4 t)}
1805- ! Toplevel input:
1806!     op F:functor X:sig type t end -> sig type u end;
1807!     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1808! Signature mismatch: the module does not match the signature ...
1809! Equality type mismatch: type constructor t of the domain
1810! is specified as admitting equality in the module
1811!   type t = t
1812! but its declaration does not admit equality in the signature
1813!   type t = t/1
1814- ! Toplevel input:
1815!     op F:functor X:sig eqtype t end -> sig eqtype u end;
1816!     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1817! Signature mismatch: the module does not match the signature ...
1818! Equality type mismatch: type constructor u of the range
1819! is specified as admitting equality in the signature
1820!   type u = (u/4 t)
1821! but its declaration does not admit equality in the module
1822!   type u = (u/5 t)
1823- > val 'a f = fn : [{type t = 'a}] -> [{type t = 'a}]
1824- > val g = fn : [{type t = int -> int}] -> [{type t = int -> int}]
1825- > val p = [structure ...] : [{type t = int -> int}]
1826- > val ok = [structure ...] : [{type t = int -> int}]
1827- > val ok = [structure ...] : [{type t = int -> int}]
1828- > val ''a f = fn : [{type t = ''a}] -> [{type t = ''a}]
1829- > val g = fn : [{type t = int * int}] -> [{type t = int * int}]
1830- > val p = [structure ...] : [{type t = int * int}]
1831- ! Warning: Value polymorphism:
1832! Free type variable(s) at top level in value identifier q
1833> val q = [structure ...] : [{type t = ''a * ''a}]
1834- ! Warning: Value polymorphism:
1835! Free type variable(s) at top level in value identifier r
1836> val r = [structure ...] : [{type t = ''b * 'c}]
1837- > val t = [structure ...] : [{type t = int -> int}]
1838- > val ok = [structure ...] : [{type t = int * int}]
1839- > val ok = [structure ...] : [{type t = int * int}]
1840- > val ok = [structure ...] : [{type t = ''a * ''a}]
1841- ! Warning: the free type variable 'c has been instantiated to ''c
1842> val ok = [structure ...] : [{type t = ''b * ''c}]
1843- ! Toplevel input:
1844! val fail = f t;
1845!              ^
1846! Type clash: expression of type
1847!   [{type t = int -> int}]
1848! cannot have type
1849!   [{type t = ''d}]
1850! because the first module type does not match the second module type ...
1851! Type mismatch: type constructor t
1852! is specified as one abbreviation in the second module type
1853!   type t = ''d
1854! but declared as a different abbreviation in the first module type
1855!   type t = int -> int
1856! The abbreviations should be equivalent (or unifiable)
1857- > val ''a' ok = fn : [{type t = ''a'}] -> [{type t = ''a'}]
1858- > val (''a', ''b') ok = fn :
1859  [{type t = ''a' * ''b'}] -> [{type t = ''a' * ''b'}]
1860- > val ''a' ok = fn : [{type 'b' t = ''a' * 'b'}] -> [{type 'b' t = ''a' * 'b'}]
1861- ! Toplevel input:
1862! fun fail x = let structure X as sig eqtype t end where type t = 'a = x in x end;
1863!                                                        ^^^^^^^^^^^
1864! Illegal where constraint: the type constructor t
1865! cannot be constrained in this way because ...
1866! Equality type mismatch: type constructor t
1867! is specified as admitting equality in the signature
1868!   type t = t
1869! but its declaration does not admit equality in the constraint
1870!   type t = 'a'
1871- ! Toplevel input:
1872! fun fail x = let structure X as sig eqtype t end where type t = ''a -> ''b  = x in x end;
1873!                                                        ^^^^^^^^^^^^^^^^^^^
1874! Illegal where constraint: the type constructor t
1875! cannot be constrained in this way because ...
1876! Equality type mismatch: type constructor t
1877! is specified as admitting equality in the signature
1878!   type t = t
1879! but its declaration does not admit equality in the constraint
1880!   type t = ''a' -> ''b'
1881- ! Toplevel input:
1882! fun fail x = let structure X as sig eqtype 'b t end where type 'b t = 'a -> 'b = x in x end;
1883!                                                           ^^^^^^^^^^^^^^^^^^^^
1884! Illegal where constraint: the type constructor t
1885! cannot be constrained in this way because ...
1886! Equality type mismatch: type constructor t
1887! is specified as admitting equality in the signature
1888!   type 'd t = 'd t
1889! but its declaration does not admit equality in the constraint
1890!   type 'b' t = 'a' -> 'b'
1891-
1892Moscow ML version 2.01a (January 2004)
1893Enter `quit();' to quit.
1894- > val 'a ok = fn : 'a -> 'a
1895- > val ('a, 'b) ok = fn : ('a -> 'b) -> 'a -> 'b
1896- ! Toplevel input:
1897! type fail = 'a -> 'b;
1898! ^^^^^^^^^^^^^^^^^^^^
1899! Unguarded type variables at the top-level
1900- > val 'a ok = fn : 'a -> 'a
1901- > val 'b ok = fn : 'b -> int
1902- ! Toplevel input:
1903! val fail = fn x:'b => let datatype d = C type t = 'b * d in (x,C): t end;
1904!                                                                ^
1905! Type clash: expression of type
1906!   d
1907! cannot have type
1908!   'a
1909! because of a scope violation:
1910! the type constructor d is a parameter
1911! that is declared within the scope of 'a
1912- > val 'a ok = fn : 'a -> 'a
1913- > New type names: =t
1914  structure Ok : {datatype t = (t,{con c : int -> t}), con c : int -> t}
1915- > New type names: t/1, t/2
1916  structure Ok' :
1917  {datatype t = (t/1,{con c : (unit -> unit) -> t/1}),
1918   con c : (unit -> unit) -> t/1}
1919  structure Ok :
1920  {datatype t = (t/2,{con c : (bool -> bool) -> t/2}),
1921   con c : (bool -> bool) -> t/2}
1922- > val it = () : unit
1923- > New type names: t/3, t/4
1924  structure Ok' :
1925  {datatype t = (t/3,{con c : (unit -> unit) -> t/3}),
1926   con c : (unit -> unit) -> t/3}
1927  structure Ok :
1928  {datatype t = (t/4,{con c : (bool -> bool) -> t/4}),
1929   con c : (bool -> bool) -> t/4}
1930- > val it = () : unit
1931- > val 'a ok = fn : 'a -> 'a
1932- > val 'a ok = fn : 'a -> [{val x : 'a}]
1933- > signature Fail = {val 'a x : 'a -> 'a}
1934- > val 'a ok = fn : 'a -> [{val x : 'a}]
1935- ! Toplevel input:
1936!     in [structure struct val x = x end as S ]
1937!        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1938! Signature mismatch: the structure does not match the signature ...
1939! Scheme mismatch: value identifier x
1940! is specified with type scheme
1941!   val 'a' x : 'a'
1942! in the signature
1943! but its declaration has the unrelated type scheme
1944!   val x : 'a
1945! in the structure
1946! The declared type scheme should be at least as general as the specified type scheme
1947- ! Toplevel input:
1948!     in [structure struct val x = x end as S ]
1949!        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1950! Signature mismatch: the structure does not match the signature ...
1951! Scheme mismatch: value identifier x
1952! is specified with type scheme
1953!   val 'b x : 'b
1954! in the signature
1955! but its declaration has the unrelated type scheme
1956!   val x : 'a
1957! in the structure
1958! The declared type scheme should be at least as general as the specified type scheme
1959- > val 'a ok = fn : 'a -> [{val x : 'a -> 'a}]
1960- > val 'a ok = fn : 'a -> [{val 'a' x : 'a' -> 'a'}]
1961- > val 'a ok = fn : 'a -> [{val 'b x : 'b -> 'b}]
1962- ! Toplevel input:
1963! ....(functor(X:sig type t end)=>struct datatype u = C of X.t end)
1964!     :functor X:sig type t end -> sig type u end.
1965! Signature mismatch: the module does not match the signature ...
1966! Scope Violation: type constructor u of the range has specification:
1967!   type u = (u t/5)
1968! in the signature
1969! but is implemented by the declaration:
1970!   datatype u = (u/1,{con C : t/5 -> u/1})
1971! in the module
1972! The declaration violates the specification because
1973! the type constructor u/1 is a parameter
1974! that is declared within the scope of u.
1975- ! Warning: Value polymorphism:
1976! Free type variable(s) at top level in value identifier y1
1977! Warning: Value polymorphism:
1978! Free type variable(s) at top level in value identifier y2
1979> val y1 = ref [] : 'a list ref
1980  val y2 = ref [] : 'b list ref
1981- ! Toplevel input:
1982! val fail : 'a list ref = y1;
1983!                          ^^
1984! Type clash: expression of type
1985!   'a list ref
1986! cannot have type
1987!   'a' list ref
1988! because of a scope violation:
1989! the type variable 'a' is a parameter
1990! that is declared within the scope of 'a
1991- ! Toplevel input:
1992! val fail : 'a list ref = y2;
1993!                          ^^
1994! Type clash: expression of type
1995!   'b list ref
1996! cannot have type
1997!   'a' list ref
1998! because of a scope violation:
1999! the type variable 'a' is a parameter
2000! that is declared within the scope of 'b
2001- ! Toplevel input:
2002! structure R : sig val r: 'a list ref end = S;
2003!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2004! Signature mismatch: the module does not match the signature ...
2005! Scheme mismatch: value identifier r
2006! is specified with type scheme
2007!   val 'a' r : 'a' list ref
2008! in the signature
2009! but its declaration has the unrelated type scheme
2010!   val r : 'c list ref
2011! in the module
2012! The declared type scheme should be at least as general as the specified type scheme
2013- ! Toplevel input:
2014! structure Fail : sig val r: 'a list ref end = S;
2015!                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2016! Signature mismatch: the module does not match the signature ...
2017! Scheme mismatch: value identifier r
2018! is specified with type scheme
2019!   val 'a' r : 'a' list ref
2020! in the signature
2021! but its declaration has the unrelated type scheme
2022!   val r : 'c list ref
2023! in the module
2024! The declared type scheme should be at least as general as the specified type scheme
2025- ! Warning: Value polymorphism:
2026! Free type variable(s) at top level in structure identifier U
2027> structure U : {val r : 'c list ref, val x : int}
2028- ! Toplevel input:
2029! structure Fail : sig val r: 'a list ref end = U;
2030!                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2031! Signature mismatch: the module does not match the signature ...
2032! Scheme mismatch: value identifier r
2033! is specified with type scheme
2034!   val 'a' r : 'a' list ref
2035! in the signature
2036! but its declaration has the unrelated type scheme
2037!   val r : 'c list ref
2038! in the module
2039! The declared type scheme should be at least as general as the specified type scheme
2040- ! Warning: Value polymorphism:
2041! Free type variable(s) at top level in structure identifier W
2042> structure W : {val r : 'd list ref}
2043- ! Toplevel input:
2044! structure Fail : sig val  r: 'a list ref end = W;
2045!                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2046! Signature mismatch: the module does not match the signature ...
2047! Scheme mismatch: value identifier r
2048! is specified with type scheme
2049!   val 'a' r : 'a' list ref
2050! in the signature
2051! but its declaration has the unrelated type scheme
2052!   val r : 'd list ref
2053! in the module
2054! The declared type scheme should be at least as general as the specified type scheme
2055- ! Toplevel input:
2056! 	    structure Fail : sig val 'a r: 'a list ref end = S;
2057! 	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2058! Signature mismatch: the module does not match the signature ...
2059! Scheme mismatch: value identifier r
2060! is specified with type scheme
2061!   val 'a' r : 'a' list ref
2062! in the signature
2063! but its declaration has the unrelated type scheme
2064!   val r : 'e list ref
2065! in the module
2066! The declared type scheme should be at least as general as the specified type scheme
2067- ! Toplevel input:
2068! val fail = x:=[C];
2069!                ^
2070! Type clash: expression of type
2071!   t/5
2072! cannot have type
2073!   'e
2074! because of a scope violation:
2075! the type constructor t/5 is a parameter
2076! that is declared within the scope of 'e
2077- ! Warning: Value polymorphism:
2078! Free type variable(s) at top level in value identifier x
2079> val x = ref [] : 'e list ref
2080- > New type names: =t/5
2081  datatype t = (t/5,{con C : t/5})
2082  con C = C : t/5
2083- ! Toplevel input:
2084! val fail = x:=[C];
2085!                ^
2086! Type clash: expression of type
2087!   t/5
2088! cannot have type
2089!   'f
2090! because of a scope violation:
2091! the type constructor t/5 is a parameter
2092! that is declared within the scope of 'f
2093- ! Toplevel input:
2094! 	val fail = x:=[C];
2095! 	               ^
2096! Type clash: expression of type
2097!   t/6
2098! cannot have type
2099!   'f
2100! because of a scope violation:
2101! the type constructor t/6 is a parameter
2102! that is declared within the scope of 'f
2103- > New type names: =t/6
2104  structure Ok :
2105  {datatype t = (t/6,{con C : t/6}),
2106   con C : t/6,
2107   val ok : unit,
2108   val x : t/6 list ref}
2109- ! Warning: Value polymorphism:
2110! Free type variable(s) at top level in structure identifier N
2111> New type names: =t/7
2112  structure N :
2113  {datatype t = (t/7,{con C : t/7}), con C : t/7, val x : 'f list ref}
2114- ! Toplevel input:
2115! val fail = N.x := [N.C];
2116!                    ^^^
2117! Type clash: expression of type
2118!   t/7
2119! cannot have type
2120!   'g
2121! because of a scope violation:
2122! the type constructor t/7 is a parameter
2123! that is declared within the scope of 'g
2124- ! Toplevel input:
2125! 	val fail = X.x:=[C];
2126! 	                 ^
2127! Type clash: expression of type
2128!   t/8
2129! cannot have type
2130!   'g
2131! because of a scope violation:
2132! the type constructor t/8 is a parameter
2133! that is declared within the scope of 'g
2134- ! Toplevel input:
2135! 	val fail = X.x:=[C];
2136! 	                 ^
2137! Type clash: expression of type
2138!   t/8
2139! cannot have type
2140!   'g
2141! because of a scope violation:
2142! the type constructor t/8 is a parameter
2143! that is declared within the scope of 'g
2144- ! Warning: Value polymorphism:
2145! Free type variable(s) at top level in value identifier y
2146! Warning: Value polymorphism:
2147! Free type variable(s) at top level in value identifier z
2148> val y = ref [] : 'g list ref
2149  val z = ref [] : 'h list ref
2150- ! Toplevel input:
2151! val fail : 'a list ref = x;
2152!                          ^
2153! Type clash: expression of type
2154!   'e list ref
2155! cannot have type
2156!   'a' list ref
2157! because of a scope violation:
2158! the type variable 'a' is a parameter
2159! that is declared within the scope of 'e
2160- ! Toplevel input:
2161! val fail : 'a list ref = z;
2162!                          ^
2163! Type clash: expression of type
2164!   'h list ref
2165! cannot have type
2166!   'a' list ref
2167! because of a scope violation:
2168! the type variable 'a' is a parameter
2169! that is declared within the scope of 'h
2170- ! Toplevel input:
2171! val fail : 'a list ref = X.x;
2172!                          ^^^
2173! Cannot access unit X before it has been loaded.
2174- ! Warning: Value polymorphism:
2175! Free type variable(s) at top level in value identifier ok
2176> val ok = ref [] : 'i list ref
2177- ! Warning: Value polymorphism:
2178! Free type variable(s) at top level in value identifier ok
2179> val ok = ref [] : 'j list ref
2180- ! Toplevel input:
2181!       val ('b) fail : 'b list ref = x
2182!                                     ^
2183! Type clash: expression of type
2184!   'k list ref
2185! cannot have type
2186!   'b' list ref
2187! because of a scope violation:
2188! the type variable 'b' is a parameter
2189! that is declared within the scope of 'k
2190- ! Toplevel input:
2191!       val ('b) fail : 'b list ref = x
2192!                                     ^
2193! Type clash: expression of type
2194!   'k list ref
2195! cannot have type
2196!   'b' list ref
2197! because of a scope violation:
2198! the type variable 'b' is a parameter
2199! that is declared within the scope of 'k
2200- ! Toplevel input:
2201!       val ('b) fail : 'b list ref = (fn y => y) x
2202!                                                 ^
2203! Type clash: expression of type
2204!   'k list ref
2205! cannot have type
2206!   'b' list ref
2207! because of a scope violation:
2208! the type variable 'b' is a parameter
2209! that is declared within the scope of 'k
2210- > val ok = ref [] : int list ref
2211- > val 'b' ok = fn : 'b' -> 'b' list ref
2212- ! Toplevel input:
2213! 	val fail = fn _ :'b => x : 'b list ref
2214! 	                       ^
2215! Type clash: expression of type
2216!   'k list ref
2217! cannot have type
2218!   'b' list ref
2219! because of a scope violation:
2220! the type variable 'b' is a parameter
2221! that is declared within the scope of 'k
2222- > val 'b' ok = fn : 'b' -> 'b' list ref
2223-
2224Moscow ML version 2.01a (January 2004)
2225Enter `quit();' to quit.
2226- > New type names: =v, =u, =t
2227  val matchsuc = "OK" : string
2228-
2229Moscow ML version 2.01a (January 2004)
2230Enter `quit();' to quit.
2231- ! Toplevel input:
2232! structure X = struct open General end: sig val + : (int * int) -> int end;
2233!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2234! Signature mismatch: the module does not match the signature ...
2235! Scheme mismatch: value identifier +
2236! is specified with type scheme
2237!   val + : int * int -> int
2238! in the signature
2239! but its declaration has the unrelated type scheme
2240!   val + : num * num -> num
2241! in the module
2242! The declared type scheme should be at least as general as the specified type scheme
2243- ! Toplevel input:
2244! structure X = struct val x = fn 1 => Div end : sig exception x of int end;
2245!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2246! Signature mismatch: the module does not match the signature ...
2247! Status mismatch: identifier x
2248! is specified as an exception in the signature
2249!   exn x : int -> exn
2250! but declared as an ordinary value in the module
2251!   val x : int -> exn
2252- ! Toplevel input:
2253! structure X = struct val x = fn y => y end : sig prim_val  x : 'a ->'a = 1 "identity" end;
2254!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2255! Signature mismatch: the module does not match the signature ...
2256! Status mismatch: identifier x
2257! is specified as a primitive in the signature
2258!   val 'a x : 'a -> 'a
2259! but declared as an ordinary value in the module
2260!   val 'a x : 'a -> 'a
2261- > exn e = e : exn
2262- > structure X : {exn e : exn}
2263- ! Toplevel input:
2264! structure X = struct val x = fn 1 => 1 end : sig val x : 'a -> 'a end;
2265!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2266! Signature mismatch: the module does not match the signature ...
2267! Scheme mismatch: value identifier x
2268! is specified with type scheme
2269!   val 'a x : 'a -> 'a
2270! in the signature
2271! but its declaration has the unrelated type scheme
2272!   val x : int -> int
2273! in the module
2274! The declared type scheme should be at least as general as the specified type scheme
2275- ! Toplevel input:
2276! structure X = struct val x = fn 1 => Div end : sig exception x of int end;
2277!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2278! Signature mismatch: the module does not match the signature ...
2279! Status mismatch: identifier x
2280! is specified as an exception in the signature
2281!   exn x : int -> exn
2282! but declared as an ordinary value in the module
2283!   val x : int -> exn
2284- ! Toplevel input:
2285! structure X = struct val x = fn y => y end : sig prim_val  x : 'a ->'a = 1 "identity" end;
2286!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2287! Signature mismatch: the module does not match the signature ...
2288! Status mismatch: identifier x
2289! is specified as a primitive in the signature
2290!   val 'a x : 'a -> 'a
2291! but declared as an ordinary value in the module
2292!   val 'a x : 'a -> 'a
2293- ! Toplevel input:
2294! structure X = struct datatype t = C of int end : sig datatype t = C of bool end;
2295!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2296! Signature mismatch: the module does not match the signature ...
2297! Scheme mismatch: value identifier C
2298! is specified with type scheme
2299!   con C : bool -> t
2300! in the signature
2301! but its declaration has the unrelated type scheme
2302!   con C : int -> t
2303! in the module
2304! The declared type scheme should be at least as general as the specified type scheme
2305- ! Toplevel input:
2306! signature S = sig type t end where type 'a t = int;
2307!                                    ^^^^^^^^^^^^^^^
2308! Illegal where constraint: the type constructor t
2309! cannot be constrained in this way because ...
2310! Arity mismatch: type constructor t
2311! is specified with arity 0 in the signature
2312!   type t = t
2313! but declared with arity 1 in the constraint
2314!   type 'a t = int
2315! The arities should agree
2316- ! Toplevel input:
2317! signature S = sig structure X : sig type t end end where type 'a X.t = int;
2318!                                                          ^^^^^^^^^^^^^^^^^
2319! Illegal where constraint: the type constructor X.t
2320! cannot be constrained in this way because ...
2321! Arity mismatch: type constructor X.t
2322! is specified with arity 0 in the signature
2323!   type t = t
2324! but declared with arity 1 in the constraint
2325!   type 'a t = int
2326! The arities should agree
2327- ! Toplevel input:
2328! signature S = sig structure Y : sig structure X : sig type t end end end where type 'a Y.X.t = int;
2329!                                                                                ^^^^^^^^^^^^^^^^^^^
2330! Illegal where constraint: the type constructor Y.X.t
2331! cannot be constrained in this way because ...
2332! Arity mismatch: type constructor Y.X.t
2333! is specified with arity 0 in the signature
2334!   type t = t
2335! but declared with arity 1 in the constraint
2336!   type 'a t = int
2337! The arities should agree
2338- ! Toplevel input:
2339! structure X = struct end:functor(X:sig end)->sig end;
2340!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2341! Signature mismatch: the module does not match the signature ...
2342! Module mismatch: The signature specifies a functor
2343! but the module is a structure
2344- ! Toplevel input:
2345! functor X = (functor(X:sig end)=>struct end) : sig end;
2346!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2347! Signature mismatch: the module does not match the signature ...
2348! Module mismatch: The signature specifies a structure
2349! but the module is a functor
2350- ! Toplevel input:
2351! functor X = (functor(X:sig end)=>struct end): functor(X:sig end)->functor(X:sig end)->sig end;
2352!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2353! Signature mismatch: the module does not match the signature ...
2354! Module mismatch: the range
2355! is specified as a functor in the signature
2356! but declared as a structure in the module
2357- ! Toplevel input:
2358! functor X = (functor(X:sig end)=>functor(X:sig end)=>struct end): functor(X:sig end)->sig end;
2359!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2360! Signature mismatch: the module does not match the signature ...
2361! Module mismatch: the range
2362! is specified as a structure in the signature
2363! but declared as a functor in the module
2364- ! Toplevel input:
2365! functor X = (functor(X:functor(X:sig end)->sig end)=>struct end): functor(X:sig end)->sig end;
2366!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2367! Signature mismatch: the module does not match the signature ...
2368! Module mismatch: the domain
2369! is specified as a functor in the module
2370! but declared as a structure in the signature
2371- ! Toplevel input:
2372! functor X = (functor(X:sig end)=>struct end): functor(F:functor(X:sig end)->sig end)->sig end;
2373!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2374! Signature mismatch: the module does not match the signature ...
2375! Module mismatch: the domain
2376! is specified as a structure in the module
2377! but declared as a functor in the signature
2378- > signature G = {type t = unit}
2379- > signature L = {}
2380- ! Toplevel input:
2381!   L:G;
2382!   ^^^
2383! Signature mismatch: the module does not match the signature ...
2384! Missing declaration: type constructor t
2385! is specified in the signature as
2386!   type t = unit
2387! but not declared in the module
2388- ! Toplevel input:
2389!   LL:functor(L:L)->G;
2390!   ^^^^^^^^^^^^^^^^^^
2391! Signature mismatch: the module does not match the signature ...
2392! Missing declaration: type constructor t of the range
2393! is specified in the signature as
2394!   type t = unit
2395! but not declared in the module
2396- ! Toplevel input:
2397!   GL:functor(L:L)->L;
2398!   ^^^^^^^^^^^^^^^^^^
2399! Signature mismatch: the module does not match the signature ...
2400! Missing declaration: type constructor t of the domain
2401! is specified in the module as
2402!   type t = unit
2403! but not declared in the signature
2404- ! Toplevel input:
2405!   YL:sig structure Y: G end;
2406!   ^^^^^^^^^^^^^^^^^^^^^^^^^
2407! Signature mismatch: the module does not match the signature ...
2408! Missing declaration: type constructor Y.t
2409! is specified in the signature as
2410!   type t = unit
2411! but not declared in the module
2412- ! Toplevel input:
2413!   L_YL:functor(L:L)->sig structure Y: G end;
2414!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2415! Signature mismatch: the module does not match the signature ...
2416! Missing declaration: type constructor Y.t of the range
2417! is specified in the signature as
2418!   type t = unit
2419! but not declared in the module
2420- ! Toplevel input:
2421!   YG_L:functor(YL:sig structure Y: L end)->L;
2422!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2423! Signature mismatch: the module does not match the signature ...
2424! Missing declaration: type constructor Y.t of the domain
2425! is specified in the module as
2426!   type t = unit
2427! but not declared in the signature
2428- ! Toplevel input:
2429!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2430!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2431! Signature mismatch: the module does not match the signature ...
2432! Missing declaration: type constructor Y.t of the domain of the range
2433! is specified in the module as
2434!   type t = unit
2435! but not declared in the signature
2436- ! Toplevel input:
2437!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2438!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2439! Signature mismatch: the module does not match the signature ...
2440! Missing declaration: type constructor Y.t of the domain of the range of F
2441! is specified in the module as
2442!   type t = unit
2443! but not declared in the signature
2444- > signature G = {val x : unit}
2445- > signature L = {}
2446- ! Toplevel input:
2447!   L:G;
2448!   ^^^
2449! Signature mismatch: the module does not match the signature ...
2450! Missing declaration: value x
2451! is specified in the signature as
2452!   val x : unit
2453! but not declared in the module
2454- ! Toplevel input:
2455!   LL:functor(L:L)->G;
2456!   ^^^^^^^^^^^^^^^^^^
2457! Signature mismatch: the module does not match the signature ...
2458! Missing declaration: value x of the range
2459! is specified in the signature as
2460!   val x : unit
2461! but not declared in the module
2462- ! Toplevel input:
2463!   GL:functor(L:L)->L;
2464!   ^^^^^^^^^^^^^^^^^^
2465! Signature mismatch: the module does not match the signature ...
2466! Missing declaration: value x of the domain
2467! is specified in the module as
2468!   val x : unit
2469! but not declared in the signature
2470- ! Toplevel input:
2471!   YL:sig structure Y: G end;
2472!   ^^^^^^^^^^^^^^^^^^^^^^^^^
2473! Signature mismatch: the module does not match the signature ...
2474! Missing declaration: value Y.x
2475! is specified in the signature as
2476!   val x : unit
2477! but not declared in the module
2478- ! Toplevel input:
2479!   L_YL:functor(L:L)->sig structure Y: G end;
2480!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2481! Signature mismatch: the module does not match the signature ...
2482! Missing declaration: value Y.x of the range
2483! is specified in the signature as
2484!   val x : unit
2485! but not declared in the module
2486- ! Toplevel input:
2487!   YG_L:functor(YL:sig structure Y: L end)->L;
2488!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2489! Signature mismatch: the module does not match the signature ...
2490! Missing declaration: value Y.x of the domain
2491! is specified in the module as
2492!   val x : unit
2493! but not declared in the signature
2494- ! Toplevel input:
2495!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2496!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2497! Signature mismatch: the module does not match the signature ...
2498! Missing declaration: value Y.x of the domain of the range
2499! is specified in the module as
2500!   val x : unit
2501! but not declared in the signature
2502- ! Toplevel input:
2503!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2504!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2505! Signature mismatch: the module does not match the signature ...
2506! Missing declaration: value Y.x of the domain of the range of F
2507! is specified in the module as
2508!   val x : unit
2509! but not declared in the signature
2510- > signature G = {structure X : {}}
2511- > signature L = {}
2512- ! Toplevel input:
2513!   L:G;
2514!   ^^^
2515! Signature mismatch: the module does not match the signature ...
2516! Missing declaration: structure X
2517! is specified in the signature as
2518!   structure X : {}
2519! but not declared in the module
2520- ! Toplevel input:
2521!   LL:functor(L:L)->G;
2522!   ^^^^^^^^^^^^^^^^^^
2523! Signature mismatch: the module does not match the signature ...
2524! Missing declaration: structure X of the range
2525! is specified in the signature as
2526!   structure X : {}
2527! but not declared in the module
2528- ! Toplevel input:
2529!   GL:functor(L:L)->L;
2530!   ^^^^^^^^^^^^^^^^^^
2531! Signature mismatch: the module does not match the signature ...
2532! Missing declaration: structure X of the domain
2533! is specified in the module as
2534!   structure X : {}
2535! but not declared in the signature
2536- ! Toplevel input:
2537!   YL:sig structure Y: G end;
2538!   ^^^^^^^^^^^^^^^^^^^^^^^^^
2539! Signature mismatch: the module does not match the signature ...
2540! Missing declaration: structure Y.X
2541! is specified in the signature as
2542!   structure X : {}
2543! but not declared in the module
2544- ! Toplevel input:
2545!   L_YL:functor(L:L)->sig structure Y: G end;
2546!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2547! Signature mismatch: the module does not match the signature ...
2548! Missing declaration: structure Y.X of the range
2549! is specified in the signature as
2550!   structure X : {}
2551! but not declared in the module
2552- ! Toplevel input:
2553!   YG_L:functor(YL:sig structure Y: L end)->L;
2554!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2555! Signature mismatch: the module does not match the signature ...
2556! Missing declaration: structure Y.X of the domain
2557! is specified in the module as
2558!   structure X : {}
2559! but not declared in the signature
2560- ! Toplevel input:
2561!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2562!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2563! Signature mismatch: the module does not match the signature ...
2564! Missing declaration: structure Y.X of the domain of the range
2565! is specified in the module as
2566!   structure X : {}
2567! but not declared in the signature
2568- ! Toplevel input:
2569!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2570!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2571! Signature mismatch: the module does not match the signature ...
2572! Missing declaration: structure Y.X of the domain of the range of F
2573! is specified in the module as
2574!   structure X : {}
2575! but not declared in the signature
2576- > signature G = {functor F : {}->{}}
2577- > signature L = {}
2578- ! Toplevel input:
2579!   L:G;
2580!   ^^^
2581! Signature mismatch: the module does not match the signature ...
2582! Missing declaration: functor F
2583! is specified in the signature as
2584!   functor F : {}->{}
2585! but not declared in the module
2586- ! Toplevel input:
2587!   LL:functor(L:L)->G;
2588!   ^^^^^^^^^^^^^^^^^^
2589! Signature mismatch: the module does not match the signature ...
2590! Missing declaration: functor F of the range
2591! is specified in the signature as
2592!   functor F : {}->{}
2593! but not declared in the module
2594- ! Toplevel input:
2595!   GL:functor(L:L)->L;
2596!   ^^^^^^^^^^^^^^^^^^
2597! Signature mismatch: the module does not match the signature ...
2598! Missing declaration: functor F of the domain
2599! is specified in the module as
2600!   functor F : {}->{}
2601! but not declared in the signature
2602- ! Toplevel input:
2603!   YL:sig structure Y: G end;
2604!   ^^^^^^^^^^^^^^^^^^^^^^^^^
2605! Signature mismatch: the module does not match the signature ...
2606! Missing declaration: functor Y.F
2607! is specified in the signature as
2608!   functor F : {}->{}
2609! but not declared in the module
2610- ! Toplevel input:
2611!   L_YL:functor(L:L)->sig structure Y: G end;
2612!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2613! Signature mismatch: the module does not match the signature ...
2614! Missing declaration: functor Y.F of the range
2615! is specified in the signature as
2616!   functor F : {}->{}
2617! but not declared in the module
2618- ! Toplevel input:
2619!   YG_L:functor(YL:sig structure Y: L end)->L;
2620!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2621! Signature mismatch: the module does not match the signature ...
2622! Missing declaration: functor Y.F of the domain
2623! is specified in the module as
2624!   functor F : {}->{}
2625! but not declared in the signature
2626- ! Toplevel input:
2627!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2628!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2629! Signature mismatch: the module does not match the signature ...
2630! Missing declaration: functor Y.F of the domain of the range
2631! is specified in the module as
2632!   functor F : {}->{}
2633! but not declared in the signature
2634- ! Toplevel input:
2635!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2636!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2637! Signature mismatch: the module does not match the signature ...
2638! Missing declaration: functor Y.F of the domain of the range of F
2639! is specified in the module as
2640!   functor F : {}->{}
2641! but not declared in the signature
2642- > signature G = {val 'a x : 'a -> 'a}
2643- > signature L = {val x : int -> int}
2644- ! Toplevel input:
2645!   L:G;
2646!   ^^^
2647! Signature mismatch: the module does not match the signature ...
2648! Scheme mismatch: value identifier x
2649! is specified with type scheme
2650!   val 'a x : 'a -> 'a
2651! in the signature
2652! but its declaration has the unrelated type scheme
2653!   val x : int -> int
2654! in the module
2655! The declared type scheme should be at least as general as the specified type scheme
2656- ! Toplevel input:
2657!   LL:functor(L:L)->G;
2658!   ^^^^^^^^^^^^^^^^^^
2659! Signature mismatch: the module does not match the signature ...
2660! Scheme mismatch: value identifier x of the range
2661! is specified with type scheme
2662!   val 'a x : 'a -> 'a
2663! in the signature
2664! but its declaration has the unrelated type scheme
2665!   val x : int -> int
2666! in the module
2667! The declared type scheme should be at least as general as the specified type scheme
2668- ! Toplevel input:
2669!   GL:functor(L:L)->L;
2670!   ^^^^^^^^^^^^^^^^^^
2671! Signature mismatch: the module does not match the signature ...
2672! Scheme mismatch: value identifier x of the domain
2673! is specified with type scheme
2674!   val 'a x : 'a -> 'a
2675! in the module
2676! but its declaration has the unrelated type scheme
2677!   val x : int -> int
2678! in the signature
2679! The declared type scheme should be at least as general as the specified type scheme
2680- ! Toplevel input:
2681!   YL:sig structure Y: G end;
2682!   ^^^^^^^^^^^^^^^^^^^^^^^^^
2683! Signature mismatch: the module does not match the signature ...
2684! Scheme mismatch: value identifier Y.x
2685! is specified with type scheme
2686!   val 'a x : 'a -> 'a
2687! in the signature
2688! but its declaration has the unrelated type scheme
2689!   val x : int -> int
2690! in the module
2691! The declared type scheme should be at least as general as the specified type scheme
2692- ! Toplevel input:
2693!   L_YL:functor(L:L)->sig structure Y: G end;
2694!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2695! Signature mismatch: the module does not match the signature ...
2696! Scheme mismatch: value identifier Y.x of the range
2697! is specified with type scheme
2698!   val 'a x : 'a -> 'a
2699! in the signature
2700! but its declaration has the unrelated type scheme
2701!   val x : int -> int
2702! in the module
2703! The declared type scheme should be at least as general as the specified type scheme
2704- ! Toplevel input:
2705!   YG_L:functor(YL:sig structure Y: L end)->L;
2706!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2707! Signature mismatch: the module does not match the signature ...
2708! Scheme mismatch: value identifier Y.x of the domain
2709! is specified with type scheme
2710!   val 'a x : 'a -> 'a
2711! in the module
2712! but its declaration has the unrelated type scheme
2713!   val x : int -> int
2714! in the signature
2715! The declared type scheme should be at least as general as the specified type scheme
2716- ! Toplevel input:
2717!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2718!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2719! Signature mismatch: the module does not match the signature ...
2720! Scheme mismatch: value identifier Y.x of the domain of the range
2721! is specified with type scheme
2722!   val 'a x : 'a -> 'a
2723! in the module
2724! but its declaration has the unrelated type scheme
2725!   val x : int -> int
2726! in the signature
2727! The declared type scheme should be at least as general as the specified type scheme
2728- ! Toplevel input:
2729!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2730!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2731! Signature mismatch: the module does not match the signature ...
2732! Scheme mismatch: value identifier Y.x of the domain of the range of F
2733! is specified with type scheme
2734!   val 'a x : 'a -> 'a
2735! in the module
2736! but its declaration has the unrelated type scheme
2737!   val x : int -> int
2738! in the signature
2739! The declared type scheme should be at least as general as the specified type scheme
2740- ! Toplevel input:
2741! 	  L:G;
2742! 	  ^^^
2743! Signature mismatch: the module does not match the signature ...
2744! Scheme mismatch: value identifier x
2745! is specified with type scheme
2746!   val 'a x : ('a -> 'a) -> 'a -> 'a
2747! in the signature
2748! but its declaration has the unrelated type scheme
2749!   val 'a x : ('a -> 'a) -> 'b -> 'b
2750! in the module
2751! The declared type scheme should be at least as general as the specified type scheme
2752- ! Toplevel input:
2753! 	  LL:functor(L:L)->G;
2754! 	  ^^^^^^^^^^^^^^^^^^
2755! Signature mismatch: the module does not match the signature ...
2756! Scheme mismatch: value identifier x of the range
2757! is specified with type scheme
2758!   val 'a x : ('a -> 'a) -> 'a -> 'a
2759! in the signature
2760! but its declaration has the unrelated type scheme
2761!   val 'a x : ('a -> 'a) -> 'b -> 'b
2762! in the module
2763! The declared type scheme should be at least as general as the specified type scheme
2764- ! Toplevel input:
2765! 	  GL:functor(L:L)->L;
2766! 	  ^^^^^^^^^^^^^^^^^^
2767! Signature mismatch: the module does not match the signature ...
2768! Scheme mismatch: value identifier x of the domain
2769! is specified with type scheme
2770!   val 'a x : ('a -> 'a) -> 'a -> 'a
2771! in the module
2772! but its declaration has the unrelated type scheme
2773!   val 'a x : ('a -> 'a) -> 'b -> 'b
2774! in the signature
2775! The declared type scheme should be at least as general as the specified type scheme
2776- ! Toplevel input:
2777! 	  YL:sig structure Y: G end;
2778! 	  ^^^^^^^^^^^^^^^^^^^^^^^^^
2779! Signature mismatch: the module does not match the signature ...
2780! Scheme mismatch: value identifier Y.x
2781! is specified with type scheme
2782!   val 'a x : ('a -> 'a) -> 'a -> 'a
2783! in the signature
2784! but its declaration has the unrelated type scheme
2785!   val 'a x : ('a -> 'a) -> 'b -> 'b
2786! in the module
2787! The declared type scheme should be at least as general as the specified type scheme
2788- ! Toplevel input:
2789! 	  L_YL:functor(L:L)->sig structure Y: G end;
2790! 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2791! Signature mismatch: the module does not match the signature ...
2792! Scheme mismatch: value identifier Y.x of the range
2793! is specified with type scheme
2794!   val 'a x : ('a -> 'a) -> 'a -> 'a
2795! in the signature
2796! but its declaration has the unrelated type scheme
2797!   val 'a x : ('a -> 'a) -> 'b -> 'b
2798! in the module
2799! The declared type scheme should be at least as general as the specified type scheme
2800- ! Toplevel input:
2801! 	  YG_L:functor(YL:sig structure Y: L end)->L;
2802! 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2803! Signature mismatch: the module does not match the signature ...
2804! Scheme mismatch: value identifier Y.x of the domain
2805! is specified with type scheme
2806!   val 'a x : ('a -> 'a) -> 'a -> 'a
2807! in the module
2808! but its declaration has the unrelated type scheme
2809!   val 'a x : ('a -> 'a) -> 'b -> 'b
2810! in the signature
2811! The declared type scheme should be at least as general as the specified type scheme
2812- ! Toplevel input:
2813! 	  L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2814! 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2815! Signature mismatch: the module does not match the signature ...
2816! Scheme mismatch: value identifier Y.x of the domain of the range
2817! is specified with type scheme
2818!   val 'a x : ('a -> 'a) -> 'a -> 'a
2819! in the module
2820! but its declaration has the unrelated type scheme
2821!   val 'a x : ('a -> 'a) -> 'b -> 'b
2822! in the signature
2823! The declared type scheme should be at least as general as the specified type scheme
2824- ! Toplevel input:
2825! 	  FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2826! 	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2827! Signature mismatch: the module does not match the signature ...
2828! Scheme mismatch: value identifier Y.x of the domain of the range of F
2829! is specified with type scheme
2830!   val 'a x : ('a -> 'a) -> 'a -> 'a
2831! in the module
2832! but its declaration has the unrelated type scheme
2833!   val 'a x : ('a -> 'a) -> 'b -> 'b
2834! in the signature
2835! The declared type scheme should be at least as general as the specified type scheme
2836- > signature G = {exn x : exn}
2837- > signature L = {val x : exn}
2838- ! Toplevel input:
2839!   L:G;
2840!   ^^^
2841! Signature mismatch: the module does not match the signature ...
2842! Status mismatch: identifier x
2843! is specified as an exception in the signature
2844!   exn x : exn
2845! but declared as an ordinary value in the module
2846!   val x : exn
2847- ! Toplevel input:
2848!   LL:functor(L:L)->G;
2849!   ^^^^^^^^^^^^^^^^^^
2850! Signature mismatch: the module does not match the signature ...
2851! Status mismatch: identifier x of the range
2852! is specified as an exception in the signature
2853!   exn x : exn
2854! but declared as an ordinary value in the module
2855!   val x : exn
2856- ! Toplevel input:
2857!   GL:functor(L:L)->L;
2858!   ^^^^^^^^^^^^^^^^^^
2859! Signature mismatch: the module does not match the signature ...
2860! Status mismatch: identifier x of the domain
2861! is specified as an exception in the module
2862!   exn x : exn
2863! but declared as an ordinary value in the signature
2864!   val x : exn
2865- ! Toplevel input:
2866!   YL:sig structure Y: G end;
2867!   ^^^^^^^^^^^^^^^^^^^^^^^^^
2868! Signature mismatch: the module does not match the signature ...
2869! Status mismatch: identifier Y.x
2870! is specified as an exception in the signature
2871!   exn x : exn
2872! but declared as an ordinary value in the module
2873!   val x : exn
2874- ! Toplevel input:
2875!   L_YL:functor(L:L)->sig structure Y: G end;
2876!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2877! Signature mismatch: the module does not match the signature ...
2878! Status mismatch: identifier Y.x of the range
2879! is specified as an exception in the signature
2880!   exn x : exn
2881! but declared as an ordinary value in the module
2882!   val x : exn
2883- ! Toplevel input:
2884!   YG_L:functor(YL:sig structure Y: L end)->L;
2885!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2886! Signature mismatch: the module does not match the signature ...
2887! Status mismatch: identifier Y.x of the domain
2888! is specified as an exception in the module
2889!   exn x : exn
2890! but declared as an ordinary value in the signature
2891!   val x : exn
2892- ! Toplevel input:
2893!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2894!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2895! Signature mismatch: the module does not match the signature ...
2896! Status mismatch: identifier Y.x of the domain of the range
2897! is specified as an exception in the module
2898!   exn x : exn
2899! but declared as an ordinary value in the signature
2900!   val x : exn
2901- ! Toplevel input:
2902!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2903!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2904! Signature mismatch: the module does not match the signature ...
2905! Status mismatch: identifier Y.x of the domain of the range of F
2906! is specified as an exception in the module
2907!   exn x : exn
2908! but declared as an ordinary value in the signature
2909!   val x : exn
2910- > signature G = /\=t.{datatype t = (t,{con C : int -> t}), con C : int -> t}
2911- > signature L = /\=t.{datatype t = (t,{con D : int -> t}), con D : int -> t}
2912- ! Toplevel input:
2913!   L:G;
2914!   ^^^
2915! Signature mismatch: the module does not match the signature ...
2916! Datatype mismatch: type constructor t
2917! is specified as the datatype
2918!   datatype t = (t,{con C : int -> t})
2919! in the signature
2920! but declared as the different datatype
2921!   datatype t = (t,{con D : int -> t})
2922! in the module
2923! The datatypes should agree on the names and the order of value constructors
2924- ! Toplevel input:
2925!   LL:functor(L:L)->G;
2926!   ^^^^^^^^^^^^^^^^^^
2927! Signature mismatch: the module does not match the signature ...
2928! Datatype mismatch: type constructor t of the range
2929! is specified as the datatype
2930!   datatype t = (t,{con C : int -> t})
2931! in the signature
2932! but declared as the different datatype
2933!   datatype t = (t,{con D : int -> t})
2934! in the module
2935! The datatypes should agree on the names and the order of value constructors
2936- ! Toplevel input:
2937!   GL:functor(L:L)->L;
2938!   ^^^^^^^^^^^^^^^^^^
2939! Signature mismatch: the module does not match the signature ...
2940! Datatype mismatch: type constructor t of the domain
2941! is specified as the datatype
2942!   datatype t = (t,{con C : int -> t})
2943! in the module
2944! but declared as the different datatype
2945!   datatype t = (t,{con D : int -> t})
2946! in the signature
2947! The datatypes should agree on the names and the order of value constructors
2948- ! Toplevel input:
2949!   YL:sig structure Y: G end;
2950!   ^^^^^^^^^^^^^^^^^^^^^^^^^
2951! Signature mismatch: the module does not match the signature ...
2952! Datatype mismatch: type constructor Y.t
2953! is specified as the datatype
2954!   datatype t = (t,{con C : int -> t})
2955! in the signature
2956! but declared as the different datatype
2957!   datatype t = (t,{con D : int -> t})
2958! in the module
2959! The datatypes should agree on the names and the order of value constructors
2960- ! Toplevel input:
2961!   L_YL:functor(L:L)->sig structure Y: G end;
2962!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2963! Signature mismatch: the module does not match the signature ...
2964! Datatype mismatch: type constructor Y.t of the range
2965! is specified as the datatype
2966!   datatype t = (t,{con C : int -> t})
2967! in the signature
2968! but declared as the different datatype
2969!   datatype t = (t,{con D : int -> t})
2970! in the module
2971! The datatypes should agree on the names and the order of value constructors
2972- ! Toplevel input:
2973!   YG_L:functor(YL:sig structure Y: L end)->L;
2974!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2975! Signature mismatch: the module does not match the signature ...
2976! Datatype mismatch: type constructor Y.t of the domain
2977! is specified as the datatype
2978!   datatype t = (t,{con C : int -> t})
2979! in the module
2980! but declared as the different datatype
2981!   datatype t = (t,{con D : int -> t})
2982! in the signature
2983! The datatypes should agree on the names and the order of value constructors
2984- ! Toplevel input:
2985!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
2986!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2987! Signature mismatch: the module does not match the signature ...
2988! Datatype mismatch: type constructor Y.t of the domain of the range
2989! is specified as the datatype
2990!   datatype t = (t,{con C : int -> t})
2991! in the module
2992! but declared as the different datatype
2993!   datatype t = (t,{con D : int -> t})
2994! in the signature
2995! The datatypes should agree on the names and the order of value constructors
2996- ! Toplevel input:
2997!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
2998!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2999! Signature mismatch: the module does not match the signature ...
3000! Datatype mismatch: type constructor Y.t of the domain of the range of F
3001! is specified as the datatype
3002!   datatype t = (t,{con C : int -> t})
3003! in the module
3004! but declared as the different datatype
3005!   datatype t = (t,{con D : int -> t})
3006! in the signature
3007! The datatypes should agree on the names and the order of value constructors
3008- > signature G = {type t = unit}
3009- > signature L = {type 'a t = unit}
3010- ! Toplevel input:
3011!   L:G;
3012!   ^^^
3013! Signature mismatch: the module does not match the signature ...
3014! Arity mismatch: type constructor t
3015! is specified with arity 0 in the signature
3016!   type t = unit
3017! but declared with arity 1 in the module
3018!   type 'a t = unit
3019! The arities should agree
3020- ! Toplevel input:
3021!   LL:functor(L:L)->G;
3022!   ^^^^^^^^^^^^^^^^^^
3023! Signature mismatch: the module does not match the signature ...
3024! Arity mismatch: type constructor t of the range
3025! is specified with arity 0 in the signature
3026!   type t = unit
3027! but declared with arity 1 in the module
3028!   type 'a t = unit
3029! The arities should agree
3030- ! Toplevel input:
3031!   GL:functor(L:L)->L;
3032!   ^^^^^^^^^^^^^^^^^^
3033! Signature mismatch: the module does not match the signature ...
3034! Arity mismatch: type constructor t of the domain
3035! is specified with arity 0 in the module
3036!   type t = unit
3037! but declared with arity 1 in the signature
3038!   type 'a t = unit
3039! The arities should agree
3040- ! Toplevel input:
3041!   YL:sig structure Y: G end;
3042!   ^^^^^^^^^^^^^^^^^^^^^^^^^
3043! Signature mismatch: the module does not match the signature ...
3044! Arity mismatch: type constructor Y.t
3045! is specified with arity 0 in the signature
3046!   type t = unit
3047! but declared with arity 1 in the module
3048!   type 'a t = unit
3049! The arities should agree
3050- ! Toplevel input:
3051!   L_YL:functor(L:L)->sig structure Y: G end;
3052!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3053! Signature mismatch: the module does not match the signature ...
3054! Arity mismatch: type constructor Y.t of the range
3055! is specified with arity 0 in the signature
3056!   type t = unit
3057! but declared with arity 1 in the module
3058!   type 'a t = unit
3059! The arities should agree
3060- ! Toplevel input:
3061!   YG_L:functor(YL:sig structure Y: L end)->L;
3062!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3063! Signature mismatch: the module does not match the signature ...
3064! Arity mismatch: type constructor Y.t of the domain
3065! is specified with arity 0 in the module
3066!   type t = unit
3067! but declared with arity 1 in the signature
3068!   type 'a t = unit
3069! The arities should agree
3070- ! Toplevel input:
3071!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
3072!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3073! Signature mismatch: the module does not match the signature ...
3074! Arity mismatch: type constructor Y.t of the domain of the range
3075! is specified with arity 0 in the module
3076!   type t = unit
3077! but declared with arity 1 in the signature
3078!   type 'a t = unit
3079! The arities should agree
3080- ! Toplevel input:
3081!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
3082!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3083! Signature mismatch: the module does not match the signature ...
3084! Arity mismatch: type constructor Y.t of the domain of the range of F
3085! is specified with arity 0 in the module
3086!   type t = unit
3087! but declared with arity 1 in the signature
3088!   type 'a t = unit
3089! The arities should agree
3090- > signature G = {type 'a myref = 'a ref}
3091- > signature L = {type 'a myref = 'a}
3092- ! Toplevel input:
3093!   L:G;
3094!   ^^^
3095! Signature mismatch: the module does not match the signature ...
3096! Type mismatch: type constructor myref
3097! is specified as one abbreviation in the signature
3098!   type 'a myref = 'a ref
3099! but declared as a different abbreviation in the module
3100!   type 'a myref = 'a
3101! The abbreviations should be equivalent (or unifiable)
3102- ! Toplevel input:
3103!   LL:functor(L:L)->G;
3104!   ^^^^^^^^^^^^^^^^^^
3105! Signature mismatch: the module does not match the signature ...
3106! Type mismatch: type constructor myref of the range
3107! is specified as one abbreviation in the signature
3108!   type 'a myref = 'a ref
3109! but declared as a different abbreviation in the module
3110!   type 'a myref = 'a
3111! The abbreviations should be equivalent (or unifiable)
3112- ! Toplevel input:
3113!   GL:functor(L:L)->L;
3114!   ^^^^^^^^^^^^^^^^^^
3115! Signature mismatch: the module does not match the signature ...
3116! Type mismatch: type constructor myref of the domain
3117! is specified as one abbreviation in the module
3118!   type 'a myref = 'a ref
3119! but declared as a different abbreviation in the signature
3120!   type 'a myref = 'a
3121! The abbreviations should be equivalent (or unifiable)
3122- ! Toplevel input:
3123!   YL:sig structure Y: G end;
3124!   ^^^^^^^^^^^^^^^^^^^^^^^^^
3125! Signature mismatch: the module does not match the signature ...
3126! Type mismatch: type constructor Y.myref
3127! is specified as one abbreviation in the signature
3128!   type 'a myref = 'a ref
3129! but declared as a different abbreviation in the module
3130!   type 'a myref = 'a
3131! The abbreviations should be equivalent (or unifiable)
3132- ! Toplevel input:
3133!   L_YL:functor(L:L)->sig structure Y: G end;
3134!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3135! Signature mismatch: the module does not match the signature ...
3136! Type mismatch: type constructor Y.myref of the range
3137! is specified as one abbreviation in the signature
3138!   type 'a myref = 'a ref
3139! but declared as a different abbreviation in the module
3140!   type 'a myref = 'a
3141! The abbreviations should be equivalent (or unifiable)
3142- ! Toplevel input:
3143!   YG_L:functor(YL:sig structure Y: L end)->L;
3144!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3145! Signature mismatch: the module does not match the signature ...
3146! Type mismatch: type constructor Y.myref of the domain
3147! is specified as one abbreviation in the module
3148!   type 'a myref = 'a ref
3149! but declared as a different abbreviation in the signature
3150!   type 'a myref = 'a
3151! The abbreviations should be equivalent (or unifiable)
3152- ! Toplevel input:
3153!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
3154!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3155! Signature mismatch: the module does not match the signature ...
3156! Type mismatch: type constructor Y.myref of the domain of the range
3157! is specified as one abbreviation in the module
3158!   type 'a myref = 'a ref
3159! but declared as a different abbreviation in the signature
3160!   type 'a myref = 'a
3161! The abbreviations should be equivalent (or unifiable)
3162- ! Toplevel input:
3163!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
3164!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3165! Signature mismatch: the module does not match the signature ...
3166! Type mismatch: type constructor Y.myref of the domain of the range of F
3167! is specified as one abbreviation in the module
3168!   type 'a myref = 'a ref
3169! but declared as a different abbreviation in the signature
3170!   type 'a myref = 'a
3171! The abbreviations should be equivalent (or unifiable)
3172- > signature G = /\=t.{type t = t}
3173- > signature L = /\t.{type t = t}
3174- ! Toplevel input:
3175!   L:G;
3176!   ^^^
3177! Signature mismatch: the module does not match the signature ...
3178! Equality type mismatch: type constructor t
3179! is specified as a `prim_EQtype' in the signature
3180!   type t = t
3181! but is not declared as a `prim_EQtype' in the module
3182!   type t = t/1
3183- ! Toplevel input:
3184!   LL:functor(L:L)->G;
3185!   ^^^^^^^^^^^^^^^^^^
3186! Signature mismatch: the module does not match the signature ...
3187! Equality type mismatch: type constructor t of the range
3188! is specified as a `prim_EQtype' in the signature
3189!   type t = t
3190! but is not declared as a `prim_EQtype' in the module
3191!   type t = t/1
3192- ! Toplevel input:
3193!   GL:functor(L:L)->L;
3194!   ^^^^^^^^^^^^^^^^^^
3195! Signature mismatch: the module does not match the signature ...
3196! Equality type mismatch: type constructor t of the domain
3197! is specified as a `prim_EQtype' in the module
3198!   type t = t
3199! but is not declared as a `prim_EQtype' in the signature
3200!   type t = t/1
3201- ! Toplevel input:
3202!   YL:sig structure Y: G end;
3203!   ^^^^^^^^^^^^^^^^^^^^^^^^^
3204! Signature mismatch: the module does not match the signature ...
3205! Equality type mismatch: type constructor Y.t
3206! is specified as a `prim_EQtype' in the signature
3207!   type t = t
3208! but is not declared as a `prim_EQtype' in the module
3209!   type t = t/1
3210- ! Toplevel input:
3211!   L_YL:functor(L:L)->sig structure Y: G end;
3212!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3213! Signature mismatch: the module does not match the signature ...
3214! Equality type mismatch: type constructor Y.t of the range
3215! is specified as a `prim_EQtype' in the signature
3216!   type t = t
3217! but is not declared as a `prim_EQtype' in the module
3218!   type t = t/1
3219- ! Toplevel input:
3220!   YG_L:functor(YL:sig structure Y: L end)->L;
3221!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3222! Signature mismatch: the module does not match the signature ...
3223! Equality type mismatch: type constructor Y.t of the domain
3224! is specified as a `prim_EQtype' in the module
3225!   type t = t
3226! but is not declared as a `prim_EQtype' in the signature
3227!   type t = t/1
3228- ! Toplevel input:
3229!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
3230!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3231! Signature mismatch: the module does not match the signature ...
3232! Equality type mismatch: type constructor Y.t of the domain of the range
3233! is specified as a `prim_EQtype' in the module
3234!   type t = t
3235! but is not declared as a `prim_EQtype' in the signature
3236!   type t = t/1
3237- ! Toplevel input:
3238!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
3239!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3240! Signature mismatch: the module does not match the signature ...
3241! Equality type mismatch: type constructor Y.t of the domain of the range of F
3242! is specified as a `prim_EQtype' in the module
3243!   type t = t
3244! but is not declared as a `prim_EQtype' in the signature
3245!   type t = t/1
3246- > signature G = /\=t.{type t = t}
3247- > signature L = {type t = unit -> unit}
3248- ! Toplevel input:
3249!   L:G;
3250!   ^^^
3251! Signature mismatch: the module does not match the signature ...
3252! Equality type mismatch: type constructor t
3253! is specified as admitting equality in the signature
3254!   type t = t
3255! but its declaration does not admit equality in the module
3256!   type t = unit -> unit
3257- ! Toplevel input:
3258!   LL:functor(L:L)->G;
3259!   ^^^^^^^^^^^^^^^^^^
3260! Signature mismatch: the module does not match the signature ...
3261! Equality type mismatch: type constructor t of the range
3262! is specified as admitting equality in the signature
3263!   type t = t
3264! but its declaration does not admit equality in the module
3265!   type t = unit -> unit
3266- ! Toplevel input:
3267!   GL:functor(L:L)->L;
3268!   ^^^^^^^^^^^^^^^^^^
3269! Signature mismatch: the module does not match the signature ...
3270! Equality type mismatch: type constructor t of the domain
3271! is specified as admitting equality in the module
3272!   type t = t
3273! but its declaration does not admit equality in the signature
3274!   type t = unit -> unit
3275- ! Toplevel input:
3276!   YL:sig structure Y: G end;
3277!   ^^^^^^^^^^^^^^^^^^^^^^^^^
3278! Signature mismatch: the module does not match the signature ...
3279! Equality type mismatch: type constructor Y.t
3280! is specified as admitting equality in the signature
3281!   type t = t
3282! but its declaration does not admit equality in the module
3283!   type t = unit -> unit
3284- ! Toplevel input:
3285!   L_YL:functor(L:L)->sig structure Y: G end;
3286!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3287! Signature mismatch: the module does not match the signature ...
3288! Equality type mismatch: type constructor Y.t of the range
3289! is specified as admitting equality in the signature
3290!   type t = t
3291! but its declaration does not admit equality in the module
3292!   type t = unit -> unit
3293- ! Toplevel input:
3294!   YG_L:functor(YL:sig structure Y: L end)->L;
3295!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3296! Signature mismatch: the module does not match the signature ...
3297! Equality type mismatch: type constructor Y.t of the domain
3298! is specified as admitting equality in the module
3299!   type t = t
3300! but its declaration does not admit equality in the signature
3301!   type t = unit -> unit
3302- ! Toplevel input:
3303!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
3304!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3305! Signature mismatch: the module does not match the signature ...
3306! Equality type mismatch: type constructor Y.t of the domain of the range
3307! is specified as admitting equality in the module
3308!   type t = t
3309! but its declaration does not admit equality in the signature
3310!   type t = unit -> unit
3311- ! Toplevel input:
3312!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
3313!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3314! Signature mismatch: the module does not match the signature ...
3315! Equality type mismatch: type constructor Y.t of the domain of the range of F
3316! is specified as admitting equality in the module
3317!   type t = t
3318! but its declaration does not admit equality in the signature
3319!   type t = unit -> unit
3320- > signature G = {type t = unit}
3321- > signature L = {type t = unit -> unit}
3322- ! Toplevel input:
3323!   L:G;
3324!   ^^^
3325! Signature mismatch: the module does not match the signature ...
3326! Type mismatch: type constructor t
3327! is specified as one abbreviation in the signature
3328!   type t = unit
3329! but declared as a different abbreviation in the module
3330!   type t = unit -> unit
3331! The abbreviations should be equivalent (or unifiable)
3332- ! Toplevel input:
3333!   LL:functor(L:L)->G;
3334!   ^^^^^^^^^^^^^^^^^^
3335! Signature mismatch: the module does not match the signature ...
3336! Type mismatch: type constructor t of the range
3337! is specified as one abbreviation in the signature
3338!   type t = unit
3339! but declared as a different abbreviation in the module
3340!   type t = unit -> unit
3341! The abbreviations should be equivalent (or unifiable)
3342- ! Toplevel input:
3343!   GL:functor(L:L)->L;
3344!   ^^^^^^^^^^^^^^^^^^
3345! Signature mismatch: the module does not match the signature ...
3346! Type mismatch: type constructor t of the domain
3347! is specified as one abbreviation in the module
3348!   type t = unit
3349! but declared as a different abbreviation in the signature
3350!   type t = unit -> unit
3351! The abbreviations should be equivalent (or unifiable)
3352- ! Toplevel input:
3353!   YL:sig structure Y: G end;
3354!   ^^^^^^^^^^^^^^^^^^^^^^^^^
3355! Signature mismatch: the module does not match the signature ...
3356! Type mismatch: type constructor Y.t
3357! is specified as one abbreviation in the signature
3358!   type t = unit
3359! but declared as a different abbreviation in the module
3360!   type t = unit -> unit
3361! The abbreviations should be equivalent (or unifiable)
3362- ! Toplevel input:
3363!   L_YL:functor(L:L)->sig structure Y: G end;
3364!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3365! Signature mismatch: the module does not match the signature ...
3366! Type mismatch: type constructor Y.t of the range
3367! is specified as one abbreviation in the signature
3368!   type t = unit
3369! but declared as a different abbreviation in the module
3370!   type t = unit -> unit
3371! The abbreviations should be equivalent (or unifiable)
3372- ! Toplevel input:
3373!   YG_L:functor(YL:sig structure Y: L end)->L;
3374!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3375! Signature mismatch: the module does not match the signature ...
3376! Type mismatch: type constructor Y.t of the domain
3377! is specified as one abbreviation in the module
3378!   type t = unit
3379! but declared as a different abbreviation in the signature
3380!   type t = unit -> unit
3381! The abbreviations should be equivalent (or unifiable)
3382- ! Toplevel input:
3383!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
3384!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3385! Signature mismatch: the module does not match the signature ...
3386! Type mismatch: type constructor Y.t of the domain of the range
3387! is specified as one abbreviation in the module
3388!   type t = unit
3389! but declared as a different abbreviation in the signature
3390!   type t = unit -> unit
3391! The abbreviations should be equivalent (or unifiable)
3392- ! Toplevel input:
3393!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
3394!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3395! Signature mismatch: the module does not match the signature ...
3396! Type mismatch: type constructor Y.t of the domain of the range of F
3397! is specified as one abbreviation in the module
3398!   type t = unit
3399! but declared as a different abbreviation in the signature
3400!   type t = unit -> unit
3401! The abbreviations should be equivalent (or unifiable)
3402- > signature G = /\=t.{datatype t = (t,{con C : t}), con C : t}
3403- > signature L = {type t = unit}
3404- ! Toplevel input:
3405!   L:G;
3406!   ^^^
3407! Signature mismatch: the module does not match the signature ...
3408! Datatype mismatch: type constructor t
3409! is specified as a datatype in the signature
3410!   datatype t = (unit,{con C : unit})
3411! but not declared as a datatype in the module
3412!   type t = unit
3413! The declaration should also be a datatype
3414- ! Toplevel input:
3415!   LL:functor(L:L)->G;
3416!   ^^^^^^^^^^^^^^^^^^
3417! Signature mismatch: the module does not match the signature ...
3418! Datatype mismatch: type constructor t of the range
3419! is specified as a datatype in the signature
3420!   datatype t = (unit,{con C : unit})
3421! but not declared as a datatype in the module
3422!   type t = unit
3423! The declaration should also be a datatype
3424- ! Toplevel input:
3425!   GL:functor(L:L)->L;
3426!   ^^^^^^^^^^^^^^^^^^
3427! Signature mismatch: the module does not match the signature ...
3428! Datatype mismatch: type constructor t of the domain
3429! is specified as a datatype in the module
3430!   datatype t = (unit,{con C : unit})
3431! but not declared as a datatype in the signature
3432!   type t = unit
3433! The declaration should also be a datatype
3434- ! Toplevel input:
3435!   YL:sig structure Y: G end;
3436!   ^^^^^^^^^^^^^^^^^^^^^^^^^
3437! Signature mismatch: the module does not match the signature ...
3438! Datatype mismatch: type constructor Y.t
3439! is specified as a datatype in the signature
3440!   datatype t = (unit,{con C : unit})
3441! but not declared as a datatype in the module
3442!   type t = unit
3443! The declaration should also be a datatype
3444- ! Toplevel input:
3445!   L_YL:functor(L:L)->sig structure Y: G end;
3446!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3447! Signature mismatch: the module does not match the signature ...
3448! Datatype mismatch: type constructor Y.t of the range
3449! is specified as a datatype in the signature
3450!   datatype t = (unit,{con C : unit})
3451! but not declared as a datatype in the module
3452!   type t = unit
3453! The declaration should also be a datatype
3454- ! Toplevel input:
3455!   YG_L:functor(YL:sig structure Y: L end)->L;
3456!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3457! Signature mismatch: the module does not match the signature ...
3458! Datatype mismatch: type constructor Y.t of the domain
3459! is specified as a datatype in the module
3460!   datatype t = (unit,{con C : unit})
3461! but not declared as a datatype in the signature
3462!   type t = unit
3463! The declaration should also be a datatype
3464- ! Toplevel input:
3465!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
3466!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3467! Signature mismatch: the module does not match the signature ...
3468! Datatype mismatch: type constructor Y.t of the domain of the range
3469! is specified as a datatype in the module
3470!   datatype t = (unit,{con C : unit})
3471! but not declared as a datatype in the signature
3472!   type t = unit
3473! The declaration should also be a datatype
3474- ! Toplevel input:
3475!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
3476!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3477! Signature mismatch: the module does not match the signature ...
3478! Datatype mismatch: type constructor Y.t of the domain of the range of F
3479! is specified as a datatype in the module
3480!   datatype t = (unit,{con C : unit})
3481! but not declared as a datatype in the signature
3482!   type t = unit
3483! The declaration should also be a datatype
3484- > signature G = /\u.!t.{type t = t}->{type u = (u t)}
3485- > signature L = !t.{type t = t}->?u.{type u = u}
3486- ! Toplevel input:
3487!   L:G;
3488!   ^^^
3489! Signature mismatch: the module does not match the signature ...
3490! Scope Violation: type constructor u of the range has specification:
3491!   type u = (u t)
3492! in the signature
3493! but is implemented by the declaration:
3494!   type u = u/1
3495! in the module
3496! The declaration violates the specification because
3497! the type constructor u/1 is a parameter
3498! that is declared within the scope of u.
3499- ! Toplevel input:
3500!   LL:functor(L:L)->G;
3501!   ^^^^^^^^^^^^^^^^^^
3502! Signature mismatch: the module does not match the signature ...
3503! Scope Violation: type constructor u of the range of the range has specification:
3504!   type u = (u t)
3505! in the signature
3506! but is implemented by the declaration:
3507!   type u = u/1
3508! in the module
3509! The declaration violates the specification because
3510! the type constructor u/1 is a parameter
3511! that is declared within the scope of u.
3512- ! Toplevel input:
3513!   GL:functor(L:L)->L;
3514!   ^^^^^^^^^^^^^^^^^^
3515! Signature mismatch: the module does not match the signature ...
3516! Scope Violation: type constructor u of the range of the domain has specification:
3517!   type u = (u t)
3518! in the module
3519! but is implemented by the declaration:
3520!   type u = u/1
3521! in the signature
3522! The declaration violates the specification because
3523! the type constructor u/1 is a parameter
3524! that is declared within the scope of u.
3525- > signature G = /\u.{functor F : !t.{type t = t}->{type u = (u t)}}
3526- > signature L = {functor F : !t.{type t = t}->?u.{type u = u}}
3527- ! Toplevel input:
3528!   YL:sig structure Y: G end;
3529!   ^^^^^^^^^^^^^^^^^^^^^^^^^
3530! Signature mismatch: the module does not match the signature ...
3531! Scope Violation: type constructor u of the range of Y.F has specification:
3532!   type u = (u t)
3533! in the signature
3534! but is implemented by the declaration:
3535!   type u = u/1
3536! in the module
3537! The declaration violates the specification because
3538! the type constructor u/1 is a parameter
3539! that is declared within the scope of u.
3540- ! Toplevel input:
3541!   L_YL:functor(L:L)->sig structure Y: G end;
3542!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3543! Signature mismatch: the module does not match the signature ...
3544! Scope Violation: type constructor u of the range of Y.F of the range has specification:
3545!   type u = (u t)
3546! in the signature
3547! but is implemented by the declaration:
3548!   type u = u/1
3549! in the module
3550! The declaration violates the specification because
3551! the type constructor u/1 is a parameter
3552! that is declared within the scope of u.
3553- ! Toplevel input:
3554!   YG_L:functor(YL:sig structure Y: L end)->L;
3555!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3556! Signature mismatch: the module does not match the signature ...
3557! Scope Violation: type constructor u of the range of Y.F of the domain has specification:
3558!   type u = (u t)
3559! in the module
3560! but is implemented by the declaration:
3561!   type u = u/1
3562! in the signature
3563! The declaration violates the specification because
3564! the type constructor u/1 is a parameter
3565! that is declared within the scope of u.
3566- ! Toplevel input:
3567!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
3568!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3569! Signature mismatch: the module does not match the signature ...
3570! Scope Violation: type constructor u of the range of Y.F of the domain of the range has specification:
3571!   type u = (u t)
3572! in the module
3573! but is implemented by the declaration:
3574!   type u = u/1
3575! in the signature
3576! The declaration violates the specification because
3577! the type constructor u/1 is a parameter
3578! that is declared within the scope of u.
3579- ! Toplevel input:
3580!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
3581!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3582! Signature mismatch: the module does not match the signature ...
3583! Scope Violation: type constructor u of the range of Y.F of the domain of the range of F has specification:
3584!   type u = (u t)
3585! in the module
3586! but is implemented by the declaration:
3587!   type u = u/1
3588! in the signature
3589! The declaration violates the specification because
3590! the type constructor u/1 is a parameter
3591! that is declared within the scope of u.
3592-
3593Moscow ML version 2.01a (January 2004)
3594Enter `quit();' to quit.
3595- > signature OK = {type t = int}
3596- > signature OK = {structure X : {type t = int}}
3597- > signature OK = {structure Y : {structure X : {type t = int}}}
3598- > signature OK = /\t.{type t = t, type u = t}
3599- > signature OK = /\u.{type u = u, type t = u}
3600- > signature OK = /\t.{structure X : {type t = t, type u = t}, type u = t}
3601- > signature OK =
3602  /\t.
3603    {structure Y : {structure X : {type t = t, type u = t}, type u = t},
3604     type u = t}
3605- > signature OK =
3606  /\t u u/1 a v.
3607    {structure Y :
3608       {structure X : {type t = t, type u = u}, type u = u/1, type a = a},
3609     structure Z :
3610       {structure Y :
3611          {structure X : {type t = t, type u = u}, type u = u/1, type v = v}},
3612     structure W : {type u = u/1, type v = v}}
3613-
3614Moscow ML version 2.01a (January 2004)
3615Enter `quit();' to quit.
3616- > structure X : {exn e : int -> exn}
3617- > structure Y : {val e : int -> exn}
3618- > val it = "OK" : string
3619- > functor F : {}->{exn e : int -> exn}
3620- > structure X : {exn e : int -> exn}
3621- > structure Y : {exn e : int -> exn}
3622- > val it = "OK" : string
3623- > val it = "OK" : string
3624- > exn s = s : exn
3625- > val it = (s, s) : exn * exn
3626-
3627Moscow ML version 2.01a (January 2004)
3628Enter `quit();' to quit.
3629- > signature S = {}
3630- > signature F = {}->{}
3631- > functor Ok : {}->{}
3632- ! Toplevel input:
3633! functor Fail(X:S) = op X;
3634!                     ^^^^
3635! Unbound functor identifier: X
3636! (In this context, it is assumed that
3637!    op X
3638!  refers to a functor.
3639!  If you actually meant the structure of the same name,
3640!  you must use the syntax:
3641!    X
3642!  to indicate this.)
3643- > functor Ok : ({}->{})->{}->{}
3644- ! Toplevel input:
3645! functor Fail(X:F) = X;
3646!                     ^
3647! Cannot access unit X before it has been loaded.
3648! (In this context, it is assumed that
3649!    X
3650!  refers to a structure.
3651!  If you actually meant the functor of the same name,
3652!  you must use the syntax:
3653!    op X
3654!  to indicate this.)
3655- > functor Ok : {}->{}
3656- > functor OK : {}->{}
3657- > functor Ok : ({}->{})->{}->{}
3658- > functor OK : ({}->{})->{}->{}
3659- > functor Ok : {}->{}
3660- > functor OK : {}->{}
3661- > functor Ok : ({}->{})->{}->{}
3662- > functor OK : ({}->{})->{}->{}
3663- > structure S : {}
3664- > functor F : {}->{}
3665- > functor H : ({}->{})->{}->{}
3666- > structure Ok : {}
3667- > structure Ok : {}
3668- > functor Ok : {}->{}
3669- > functor Ok : {}->{}
3670- > structure S : {}
3671- > functor F : {}->{}
3672- > functor G : {}->{}
3673- > functor H : ({}->{})->{}->{}
3674- > structure Ok : {}
3675- > structure Ok : {}
3676- > functor Ok : {}->{}
3677- > functor Ok : {}->{}
3678- > functor Ok : {}->{}
3679- ! Toplevel input:
3680! functor Fail(X:S) = let in op X end;
3681!                            ^^^^
3682! Unbound functor identifier: X
3683! (In this context, it is assumed that
3684!    op X
3685!  refers to a functor.
3686!  If you actually meant the structure of the same name,
3687!  you must use the syntax:
3688!    X
3689!  to indicate this.)
3690- > functor Ok : ({}->{})->{}->{}
3691- ! Toplevel input:
3692! functor Fail(X:F) = let in X end;
3693!                            ^
3694! Cannot access unit X before it has been loaded.
3695! (In this context, it is assumed that
3696!    X
3697!  refers to a structure.
3698!  If you actually meant the functor of the same name,
3699!  you must use the syntax:
3700!    op X
3701!  to indicate this.)
3702- > functor Ok : {}->{}
3703- > functor OK : {}->{}
3704- > functor Ok : ({}->{})->{}->{}
3705- > functor OK : ({}->{})->{}->{}
3706-
3707Moscow ML version 2.01a (January 2004)
3708Enter `quit();' to quit.
3709- > val integer = fn : int -> int
3710- > val ok = fn : int -> int
3711- - > val ok = fn : int -> int
3712- > val ok = fn : int -> int
3713- > functor OK : !a.{type a = a, val a : a}->{val 'a x : a -> 'a -> a}
3714- ! Toplevel input:
3715! 					       else  B.b
3716! 					             ^^^
3717! Type clash: expression of type
3718!   b
3719! cannot have type
3720!   'a
3721! because of a scope violation:
3722! the type constructor b is a parameter
3723! that is declared within the scope of 'a
3724- > functor OK : !a.{type a = a, val a : a}->{val 'a x : 'a -> 'a -> 'a}
3725- - ! Toplevel input:
3726!             		                     (if true then j else B.b))
3727!             		                                          ^^^
3728! Type clash: expression of type
3729!   b
3730! cannot have type
3731!   'a
3732! because of a scope violation:
3733! the type constructor b is a parameter
3734! that is declared within the scope of 'a
3735-
3736Moscow ML version 2.01a (January 2004)
3737Enter `quit();' to quit.
3738- ! Toplevel input:
3739! ..................rec(Fail: sig type a; type b end)
3740!     sig
3741!     end.
3742! Illegal recursive signature: the body does not match the forward specification...
3743! Missing declaration: type constructor a
3744! is specified in the forward specification as
3745!   type a = a
3746! but not declared in the body
3747- ! Toplevel input:
3748! signature Fail2 = rec(Fail:functor(Y:sig end)->sig end)
3749!                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3750! Illegal recursive signature: the forward specification should specify a structure but actually specifies a functor
3751- ! Toplevel input:
3752!     functor(Fail:sig end)->sig end;
3753!     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3754! Illegal recursive signature: the body should specify a structure but actually specifies a functor
3755- ! Toplevel input:
3756! ..................rec(Fail: sig type a; type b end)
3757!                 sig type a = Fail.a
3758!                     type b = Fail.b
3759!                  end.
3760! Illegal recursive signature: the body does not match the forward specification...
3761! Circularity: type constructor a has specification:
3762!   type a = a
3763! in the forward specification
3764! but is implemented by the declaration:
3765!   type a = a
3766! in the body
3767! The declaration violates the specification because
3768! of the circular occurrence of a
3769- ! Toplevel input:
3770! ..................rec(Fail: sig type a; type b end)
3771!                 sig type a = Fail.b
3772!                     type b = Fail.a
3773!                  end.
3774! Illegal recursive signature: the body does not match the forward specification...
3775! Circularity: type constructor b has specification:
3776!   type b = b
3777! in the forward specification
3778! but is implemented by the declaration:
3779!   type b = b
3780! in the body
3781! The declaration violates the specification because
3782! of the circular occurrence of b
3783- ! Toplevel input:
3784! ..................rec(Fail: sig type a; eqtype b end)
3785!                  sig datatype a = Aa | Ba of Fail.b
3786!                      datatype b = Ab | Bb of Fail.a
3787!                  end.
3788! Illegal recursive signature: the body does not match the forward specification...
3789! Equality type mismatch: type constructor b
3790! is specified as admitting equality in the forward specification
3791!   type b = b
3792! but its declaration does not admit equality in the body
3793!   datatype b = (b/1,{con Ab : b/1, con Bb : a -> b/1})
3794- > signature Ok1 =
3795  /\a b.
3796    rec ({type a = a, type b = b},
3797            {datatype a = (a,{con Aa : a, con Ba : b -> a}),
3798             con Aa : a,
3799             con Ba : b -> a,
3800             datatype b = (b,{con Ab : b, con Bb : a -> b}),
3801             con Ab : b,
3802             con Bb : a -> b})
3803- > signature Ok2 =
3804  /\a b.
3805    rec ({type a = a, type b = b},
3806            {datatype a = (a,{con Aa : a, con Ba : b -> a}),
3807             con Aa : a,
3808             con Ba : b -> a,
3809             datatype b = (b,{con Ab : b, con Bb : a -> b}),
3810             con Ab : b,
3811             con Bb : a -> b})
3812- > signature Ok3 =
3813  /\b a.
3814    rec ({type a = a, type b = b},
3815            {datatype b = (b,{con Ab : b, con Bb : a -> b}),
3816             con Ab : b,
3817             con Bb : a -> b,
3818             datatype a = (a,{con Aa : a, con Ba : b -> a}),
3819             con Aa : a,
3820             con Ba : b -> a})
3821- > signature OK4 =
3822  /\=a =b.
3823    rec ({type a = a, type b = b},
3824            {datatype a = (a,{con Aa : a, con Ba : b -> a}),
3825             con Aa : a,
3826             con Ba : b -> a,
3827             datatype b = (b,{con Ab : b, con Bb : a -> b}),
3828             con Ab : b,
3829             con Bb : a -> b})
3830- > signature Ok5 = /\a b.rec ({type a = a, type b = b},{type a = a, type b = b})
3831- > signature Ok6 = rec ({type a = int},{type a = int})
3832- > signature OK7 =
3833  /\=a =b.
3834    rec ({datatype a = (a,{con Aa : a, con Ba : b -> a}),
3835          datatype b = (b,{con Ab : b, con Bb : a -> b}),
3836          con Aa : a,
3837          con Ba : b -> a,
3838          con Ab : b,
3839          con Bb : a -> b},
3840            {datatype a = (a,{con Aa : a, con Ba : b -> a}),
3841             con Aa : a,
3842             con Ba : b -> a,
3843             datatype b = (b,{con Ab : b, con Bb : a -> b}),
3844             con Ab : b,
3845             con Bb : a -> b})
3846- > signature OK8 =
3847  /\=b =a.
3848    rec ({datatype a = (a,{con Aa : a, con Ba : b -> a}),
3849          datatype b = (b,{con Ab : b, con Bb : a -> b}),
3850          con Aa : a,
3851          con Ba : b -> a,
3852          con Ab : b,
3853          con Bb : a -> b},
3854            {datatype a = (a,{con Aa : a, con Ba : b -> a}),
3855             datatype b = (b,{con Ab : b, con Bb : a -> b}),
3856             con Aa : a,
3857             con Ba : b -> a,
3858             con Ab : b,
3859             con Bb : a -> b})
3860- > structure Ok : {}
3861- > structure Even : {val even : int -> bool}
3862- > val test1 = true : bool
3863- > structure EvenOdd : {val even : int -> bool, val odd : int -> bool}
3864- > val test2 = true : bool
3865- > val tes3 = false : bool
3866- > signature U =
3867  /\a b.
3868    rec ({structure A : {type a = a}, structure B : {type b = b}},
3869            {structure A :
3870               {datatype a = (a,{con Aa : a, con Ba : b -> a}),
3871                con Aa : a,
3872                con Ba : b -> a},
3873             structure B :
3874               {datatype b = (b,{con Ab : b, con Bb : a -> b}),
3875                con Ab : b,
3876                con Bb : a -> b}})
3877- > New type names: a, b
3878  structure U :
3879  {structure A :
3880     {datatype a = (a,{con Aa : a, con Ba : b -> a}),
3881      con Aa : a,
3882      con Ba : b -> a},
3883   structure B :
3884     {datatype b = (b,{con Ab : b, con Bb : a -> b}),
3885      con Ab : b,
3886      con Bb : a -> b}}
3887- > signature V =
3888  /\a/1 b/1.
3889    rec ({structure A : {type a = a/1}, structure B : {type b = b/1}},
3890            {structure A :
3891               {datatype a = (a/1,{con Aa : a/1, con Ba : b/1 -> a/1}),
3892                con Aa : a/1,
3893                con Ba : b/1 -> a/1,
3894                val height : a/1 -> int},
3895             structure B :
3896               {datatype b = (b/1,{con Ab : b/1, con Bb : a/1 -> b/1}),
3897                con Ab : b/1,
3898                con Bb : a/1 -> b/1,
3899                val height : b/1 -> int}})
3900- > New type names: a/1, b/1
3901  structure V :
3902  {structure A :
3903     {datatype a = (a/1,{con Aa : a/1, con Ba : b/1 -> a/1}),
3904      con Aa : a/1,
3905      con Ba : b/1 -> a/1,
3906      val height : a/1 -> int},
3907   structure B :
3908     {datatype b = (b/1,{con Ab : b/1, con Bb : a/1 -> b/1}),
3909      con Ab : b/1,
3910      con Bb : a/1 -> b/1,
3911      val height : b/1 -> int}}
3912- > val test4 = 2 : int
3913- > val test5 = 3 : int
3914- > structure V1 :
3915  {structure A :
3916     {datatype a = (a/1,{con Aa : a/1, con Ba : b/1 -> a/1}),
3917      con Aa : a/1,
3918      con Ba : b/1 -> a/1,
3919      val height : a/1 -> int},
3920   structure B :
3921     {datatype b = (b/1,{con Ab : b/1, con Bb : a/1 -> b/1}),
3922      con Ab : b/1,
3923      con Bb : a/1 -> b/1,
3924      val height : b/1 -> int}}
3925- > New type names: a/2, b/2
3926  structure V2 :
3927  {structure A :
3928     {datatype a = (a/2,{con Aa : a/2, con Ba : b/2 -> a/2}),
3929      con Aa : a/2,
3930      con Ba : b/2 -> a/2,
3931      val height : a/2 -> int},
3932   structure B :
3933     {datatype b = (b/2,{con Ab : b/2, con Bb : a/2 -> b/2}),
3934      con Ab : b/2,
3935      con Bb : a/2 -> b/2,
3936      val height : b/2 -> int}}
3937- > New type names: a/3, b/3
3938  structure Y :
3939  {structure A :
3940     {datatype a = (a/3,{con Aa : a/3, con Ba : b/3 -> a/3}),
3941      con Aa : a/3,
3942      con Ba : b/3 -> a/3,
3943      val foo : int,
3944      val height : a/3 -> int},
3945   structure B :
3946     {datatype b = (b/3,{con Ab : b/3, con Bb : a/3 -> b/3}),
3947      con Ab : b/3,
3948      con Bb : a/3 -> b/3,
3949      val bar : bool,
3950      val height : b/3 -> int}}
3951- > structure Y1 :
3952  {structure A :
3953     {datatype a = (a/3,{con Aa : a/3, con Ba : b/3 -> a/3}),
3954      con Aa : a/3,
3955      con Ba : b/3 -> a/3,
3956      val height : a/3 -> int},
3957   structure B :
3958     {datatype b = (b/3,{con Ab : b/3, con Bb : a/3 -> b/3}),
3959      con Ab : b/3,
3960      con Bb : a/3 -> b/3,
3961      val height : b/3 -> int}}
3962- > New type names: a/4, b/4
3963  structure Y2 :
3964  {structure A :
3965     {datatype a = (a/4,{con Aa : a/4, con Ba : b/4 -> a/4}),
3966      con Aa : a/4,
3967      con Ba : b/4 -> a/4,
3968      val height : a/4 -> int},
3969   structure B :
3970     {datatype b = (b/4,{con Ab : b/4, con Bb : a/4 -> b/4}),
3971      con Ab : b/4,
3972      con Bb : a/4 -> b/4,
3973      val height : b/4 -> int}}
3974- > val test6 = [structure ...] :
3975  [?a/5 b/5.
3976    rec ({structure A : {type a = a/5}, structure B : {type b = b/5}},
3977            {structure A :
3978               {datatype a = (a/5,{con Aa : a/5, con Ba : b/5 -> a/5}),
3979                con Aa : a/5,
3980                con Ba : b/5 -> a/5,
3981                val height : a/5 -> int},
3982             structure B :
3983               {datatype b = (b/5,{con Ab : b/5, con Bb : a/5 -> b/5}),
3984                con Ab : b/5,
3985                con Bb : a/5 -> b/5,
3986                val height : b/5 -> int}})]
3987- > signature S =
3988  /\a/5.
3989    rec ({type a = a/5},
3990            {datatype a = (a/5,{con C : a/5 -> a/5}), con C : a/5 -> a/5})
3991- > New type names: a/5
3992  structure A : {datatype a = (a/5,{con C : a/5 -> a/5}), con C : a/5 -> a/5}
3993- > New type names: a/6
3994  structure B : {datatype a = (a/6,{con C : a/6 -> a/6}), con C : a/6 -> a/6}
3995- > New type names: a/7
3996  structure C : {datatype a = (a/7,{con C : a/7 -> a/7}), con C : a/7 -> a/7}
3997- > signature S =
3998  /\a/8.
3999    rec ({type ('a, 'b) a = ('a, 'b) a/8},
4000            {datatype ('a, 'b) a =
4001               (('a, 'b) a/8,
4002                {con ('a, 'b) C : ('a, 'b) a/8 -> ('a, 'b) a/8,
4003                 con ('a, 'b) D : 'a -> ('a, 'b) a/8,
4004                 con ('a, 'b) E : 'b -> ('a, 'b) a/8}),
4005             con ('a, 'b) C : ('a, 'b) a/8 -> ('a, 'b) a/8,
4006             con ('a, 'b) D : 'a -> ('a, 'b) a/8,
4007             con ('a, 'b) E : 'b -> ('a, 'b) a/8})
4008- > New type names: a/8
4009  structure A :
4010  {datatype ('a, 'b) a =
4011     (('a, 'b) a/8,
4012      {con ('a, 'b) C : ('a, 'b) a/8 -> ('a, 'b) a/8,
4013       con ('a, 'b) D : 'a -> ('a, 'b) a/8,
4014       con ('a, 'b) E : 'b -> ('a, 'b) a/8}),
4015   con ('a, 'b) C : ('a, 'b) a/8 -> ('a, 'b) a/8,
4016   con ('a, 'b) D : 'a -> ('a, 'b) a/8,
4017   con ('a, 'b) E : 'b -> ('a, 'b) a/8}
4018- > New type names: a/9
4019  structure B :
4020  {datatype ('a, 'b) a =
4021     (('a, 'b) a/9,
4022      {con ('a, 'b) C : ('a, 'b) a/9 -> ('a, 'b) a/9,
4023       con ('a, 'b) D : 'a -> ('a, 'b) a/9,
4024       con ('a, 'b) E : 'b -> ('a, 'b) a/9}),
4025   con ('a, 'b) C : ('a, 'b) a/9 -> ('a, 'b) a/9,
4026   con ('a, 'b) D : 'a -> ('a, 'b) a/9,
4027   con ('a, 'b) E : 'b -> ('a, 'b) a/9}
4028- > New type names: a/10
4029  structure C :
4030  {datatype ('a, 'b) a =
4031     (('a, 'b) a/10,
4032      {con ('a, 'b) C : ('a, 'b) a/10 -> ('a, 'b) a/10,
4033       con ('a, 'b) D : 'a -> ('a, 'b) a/10,
4034       con ('a, 'b) E : 'b -> ('a, 'b) a/10}),
4035   con ('a, 'b) C : ('a, 'b) a/10 -> ('a, 'b) a/10,
4036   con ('a, 'b) D : 'a -> ('a, 'b) a/10,
4037   con ('a, 'b) E : 'b -> ('a, 'b) a/10}
4038- > signature S =
4039  /\=a/11.
4040    rec ({datatype ('a, 'b) a =
4041            (('a, 'b) a/11,
4042             {con ('a, 'b) C : ('a, 'b) a/11 -> ('a, 'b) a/11,
4043              con ('a, 'b) D : 'a -> ('a, 'b) a/11,
4044              con ('a, 'b) E : 'b -> ('a, 'b) a/11}),
4045          con ('a, 'b) C : ('a, 'b) a/11 -> ('a, 'b) a/11,
4046          con ('a, 'b) D : 'a -> ('a, 'b) a/11,
4047          con ('a, 'b) E : 'b -> ('a, 'b) a/11},
4048            {datatype ('a, 'b) a =
4049               (('a, 'b) a/11,
4050                {con ('a, 'b) C : ('a, 'b) a/11 -> ('a, 'b) a/11,
4051                 con ('a, 'b) D : 'a -> ('a, 'b) a/11,
4052                 con ('a, 'b) E : 'b -> ('a, 'b) a/11}),
4053             con ('a, 'b) C : ('a, 'b) a/11 -> ('a, 'b) a/11,
4054             con ('a, 'b) D : 'a -> ('a, 'b) a/11,
4055             con ('a, 'b) E : 'b -> ('a, 'b) a/11})
4056- > New type names: =a/11
4057  structure A :
4058  {datatype ('a, 'b) a =
4059     (('a, 'b) a/11,
4060      {con ('a, 'b) C : ('a, 'b) a/11 -> ('a, 'b) a/11,
4061       con ('a, 'b) D : 'a -> ('a, 'b) a/11,
4062       con ('a, 'b) E : 'b -> ('a, 'b) a/11}),
4063   con ('a, 'b) C : ('a, 'b) a/11 -> ('a, 'b) a/11,
4064   con ('a, 'b) D : 'a -> ('a, 'b) a/11,
4065   con ('a, 'b) E : 'b -> ('a, 'b) a/11}
4066- > New type names: =a/12
4067  structure B :
4068  {datatype ('a, 'b) a =
4069     (('a, 'b) a/12,
4070      {con ('a, 'b) C : ('a, 'b) a/12 -> ('a, 'b) a/12,
4071       con ('a, 'b) D : 'a -> ('a, 'b) a/12,
4072       con ('a, 'b) E : 'b -> ('a, 'b) a/12}),
4073   con ('a, 'b) C : ('a, 'b) a/12 -> ('a, 'b) a/12,
4074   con ('a, 'b) D : 'a -> ('a, 'b) a/12,
4075   con ('a, 'b) E : 'b -> ('a, 'b) a/12}
4076- > New type names: =a/13
4077  structure C :
4078  {datatype ('a, 'b) a =
4079     (('a, 'b) a/13,
4080      {con ('a, 'b) C : ('a, 'b) a/13 -> ('a, 'b) a/13,
4081       con ('a, 'b) D : 'a -> ('a, 'b) a/13,
4082       con ('a, 'b) E : 'b -> ('a, 'b) a/13}),
4083   con ('a, 'b) C : ('a, 'b) a/13 -> ('a, 'b) a/13,
4084   con ('a, 'b) D : 'a -> ('a, 'b) a/13,
4085   con ('a, 'b) E : 'b -> ('a, 'b) a/13}
4086- > signature S = /\t.{type t = t}
4087- > signature Ok =
4088  /\t.rec ({type t = t},{datatype t = (t,{con C : t -> t}), con C : t -> t})
4089- > signature Ok = rec ({type t = int},{type t = int})
4090- > signature Ok = rec ({type t = int -> int},{type t = int -> int})
4091- ! Toplevel input:
4092! signature Wrong = rec (X : S) sig type t = X.t end;
4093!                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4094! Illegal recursive signature: the body does not match the forward specification...
4095! Circularity: type constructor t has specification:
4096!   type t = t
4097! in the forward specification
4098! but is implemented by the declaration:
4099!   type t = t
4100! in the body
4101! The declaration violates the specification because
4102! of the circular occurrence of t
4103- ! Toplevel input:
4104! signature Wrong = rec (X : S) sig type t = unit -> X.t end;
4105!                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4106! Illegal recursive signature: the body does not match the forward specification...
4107! Circularity: type constructor t has specification:
4108!   type t = t
4109! in the forward specification
4110! but is implemented by the declaration:
4111!   type t = unit -> t
4112! in the body
4113! The declaration violates the specification because
4114! of the circular occurrence of t
4115- > signature S = {type t = int}
4116- > signature Ok = rec ({type t = int},{type t = int})
4117- ! Toplevel input:
4118! signature Wrong = rec (X : S) sig datatype t = C of X.t end;
4119!                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4120! Illegal recursive signature: the body does not match the forward specification...
4121! Type mismatch: type constructor t
4122! is specified as one abbreviation in the forward specification
4123!   type t = int
4124! but declared as a different abbreviation in the body
4125!   datatype t = (t,{con C : int -> t})
4126! The abbreviations should be equivalent (or unifiable)
4127- > signature Ok = rec ({type t = int},{type t = int})
4128- ! Toplevel input:
4129! signature Wrong = rec (X : S) sig type t = unit -> X.t end;
4130!                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4131! Illegal recursive signature: the body does not match the forward specification...
4132! Type mismatch: type constructor t
4133! is specified as one abbreviation in the forward specification
4134!   type t = int
4135! but declared as a different abbreviation in the body
4136!   type t = unit -> int
4137! The abbreviations should be equivalent (or unifiable)
4138- > signature S = /\t.{type 'a t = 'a t}
4139- > signature Ok = rec ({type 'a t = 'a list},{type 'a t = 'a list})
4140- > signature Ok = rec ({type 'a t = 'a list},{type 'a t = 'a list})
4141- > signature S = {type 'a t = 'a list}
4142- > signature Ok = rec ({type 'a t = 'a list},{type 'a t = 'a list})
4143- ! Toplevel input:
4144! signature Wrong = rec (X : S) sig type 'a t = 'a  end;
4145!                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4146! Illegal recursive signature: the body does not match the forward specification...
4147! Type mismatch: type constructor t
4148! is specified as one abbreviation in the forward specification
4149!   type 'a t = 'a list
4150! but declared as a different abbreviation in the body
4151!   type 'a t = 'a
4152! The abbreviations should be equivalent (or unifiable)
4153- ! Toplevel input:
4154! signature Wrong = rec (X : S) S where type 'a t = 'a list;
4155!                                       ^^^^^^^^^^^^^^^^^^^
4156! Illegal where constraint: the type constructor t
4157! refers to a transparent type specification
4158! but should refer to an opaque type or datatype specification
4159-
4160Moscow ML version 2.01a (January 2004)
4161Enter `quit();' to quit.
4162- > signature ORDERED = /\T.{type T = T, val leq : T * T -> bool}
4163- > signature HEAP =
4164  /\T Heap.
4165    {structure Elem : {type T = T, val leq : T * T -> bool},
4166     type Heap = Heap,
4167     val empty : Heap,
4168     val isEmpty : Heap -> bool,
4169     val insert : T * Heap -> Heap,
4170     val merge : Heap * Heap -> Heap,
4171     exn Empty : exn,
4172     val findMin : Heap -> T,
4173     val deleteMin : Heap -> Heap}
4174- ! Toplevel input:
4175! 		      fun leq (H (x, _), H (y, _))= Elem.leq (x, y)
4176! 		          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4177! Warning: pattern matching is not exhaustive
4178
4179! Toplevel input:
4180!         else let val (H (y, p1)) = PrimH.findMin p
4181!                      ^^^^^^^^^^^
4182! Warning: pattern matching is not exhaustive
4183
4184> functor Bootstrap :
4185  (!T.
4186    {type T = T, val leq : T * T -> bool}->
4187        ?Heap.
4188         {structure Elem : {type T = T, val leq : T * T -> bool},
4189          type Heap = Heap,
4190          val empty : Heap,
4191          val isEmpty : Heap -> bool,
4192          val insert : T * Heap -> Heap,
4193          val merge : Heap * Heap -> Heap,
4194          exn Empty : exn,
4195          val findMin : Heap -> T,
4196          val deleteMin : Heap -> Heap})->
4197      !T.
4198       {type T = T, val leq : T * T -> bool}->
4199           ?Heap T/1.
4200            {structure Elem : {type T = T, val leq : T * T -> bool},
4201             type Heap = T/1,
4202             exn Empty : exn,
4203             val deleteMin : T/1 -> T/1,
4204             val empty : T/1,
4205             val findMin : T/1 -> T,
4206             val insert : T * T/1 -> T/1,
4207             val isEmpty : T/1 -> bool,
4208             val merge : T/1 * T/1 -> T/1}
4209- > functor PairingHeap :
4210  !T.
4211   {type T = T, val leq : T * T -> bool}->
4212       ?Heap.
4213        {structure Elem : {type T = T, val leq : T * T -> bool},
4214         type Heap = Heap,
4215         exn Empty : exn,
4216         val deleteMin : Heap -> Heap,
4217         val empty : Heap,
4218         val findMin : Heap -> T,
4219         val insert : T * Heap -> Heap,
4220         val isEmpty : Heap -> bool,
4221         val merge : Heap * Heap -> Heap}
4222- > structure IntElem : {type T = int, val leq : int * int -> bool}
4223- > New type names: Heap, T
4224  structure IntHeap :
4225  {structure Elem : {type T = int, val leq : int * int -> bool},
4226   type Heap = T,
4227   exn Empty : exn,
4228   val deleteMin : T -> T,
4229   val empty : T,
4230   val findMin : T -> int,
4231   val insert : int * T -> T,
4232   val isEmpty : T -> bool,
4233   val merge : T * T -> T}
4234- > val mkHeap = fn : int list -> T
4235- > val heap = ?{H}(1, <Heap T>) : T
4236- > val test1 = true : bool
4237- > val test2 = true : bool
4238- > New type names: Heap/1, T/1
4239  structure SkewHeap :
4240  {structure Elem : {type T = int, val leq : int * int -> bool},
4241   type Heap = T/1,
4242   exn Empty : exn,
4243   val deleteMin : T/1 -> T/1,
4244   val empty : T/1,
4245   val findMin : T/1 -> int,
4246   val insert : int * T/1 -> T/1,
4247   val isEmpty : T/1 -> bool,
4248   val merge : T/1 * T/1 -> T/1}
4249  functor SkewBinomialHeap :
4250  !T/2.
4251   {type T = T/2, val leq : T/2 * T/2 -> bool}->
4252       ?Tree.
4253        {structure Elem : {type T = T/2, val leq : T/2 * T/2 -> bool},
4254         type Heap = Tree list,
4255         exn Empty : exn,
4256         val deleteMin : Tree list -> Tree list,
4257         val empty : Tree list,
4258         val findMin : Tree list -> T/2,
4259         val insert : T/2 * Tree list -> Tree list,
4260         val isEmpty : Tree list -> bool,
4261         val merge : Tree list * Tree list -> Tree list}
4262- > val mkHeap = fn : int list -> T/1
4263- > val heap = ?{H}(1, <Heap/1 T/1>) : T/1
4264- > val test1 = true : bool
4265- > val test2 = true : bool
4266-
4267Moscow ML version 2.01a (January 2004)
4268Enter `quit();' to quit.
4269- > New type names: =a
4270  datatype a = (a,{con A : a})
4271  con A = A : a
4272- > New type names: =b
4273  datatype b = (b,{con B : b})
4274  con B = B : b
4275- > signature G =
4276  /\=d.
4277    {datatype d = (d,{con C : a * b -> d, con D : d}),
4278     con C : a * b -> d,
4279     con D : d}
4280- > signature L =
4281  /\=d.
4282    {datatype d = (d,{con C : (a * b) -> d, con D : d}),
4283     con C : (a * b) -> d,
4284     con D : d}
4285- ! Toplevel input:
4286!   L:G;
4287!   ^^^
4288! Signature mismatch: the module does not match the signature ...
4289! Status mismatch: constructor  C
4290! is specified as a constructor carrying 2 fields of a tuple in the signature
4291!   con C : a * b -> d
4292! but declared as a constructor carrying a tuple with 2 fields in the module
4293!   con C : (a * b) -> d
4294! EITHER: edit the specification to match the declaration:
4295! - in the signature, enclose the argument type of the constructor in parentheses:
4296!   change "C of  <ty_1> * <ty_2>"
4297!   to     "C of (<ty_1> * <ty_2>)"
4298! OR: edit the declaration to match the specification:
4299! - in the module, re-express the argument type of the constructor as a syntactic tuple:
4300!   change "C of <ty>"
4301!   to     "C of <ty_1> * <ty_2>"
4302- ! Toplevel input:
4303!   LL:functor(L:L)->G;
4304!   ^^^^^^^^^^^^^^^^^^
4305! Signature mismatch: the module does not match the signature ...
4306! Status mismatch: constructor  C of the range
4307! is specified as a constructor carrying 2 fields of a tuple in the signature
4308!   con C : a * b -> d
4309! but declared as a constructor carrying a tuple with 2 fields in the module
4310!   con C : (a * b) -> d
4311! EITHER: edit the specification to match the declaration:
4312! - in the signature, enclose the argument type of the constructor in parentheses:
4313!   change "C of  <ty_1> * <ty_2>"
4314!   to     "C of (<ty_1> * <ty_2>)"
4315! OR: edit the declaration to match the specification:
4316! - in the module, re-express the argument type of the constructor as a syntactic tuple:
4317!   change "C of <ty>"
4318!   to     "C of <ty_1> * <ty_2>"
4319- ! Toplevel input:
4320!   GL:functor(L:L)->L;
4321!   ^^^^^^^^^^^^^^^^^^
4322! Signature mismatch: the module does not match the signature ...
4323! Status mismatch: constructor  C of the domain
4324! is specified as a constructor carrying 2 fields of a tuple in the module
4325!   con C : a * b -> d
4326! but declared as a constructor carrying a tuple with 2 fields in the signature
4327!   con C : (a * b) -> d
4328! EITHER: edit the specification to match the declaration:
4329! - in the module, enclose the argument type of the constructor in parentheses:
4330!   change "C of  <ty_1> * <ty_2>"
4331!   to     "C of (<ty_1> * <ty_2>)"
4332! OR: edit the declaration to match the specification:
4333! - in the signature, re-express the argument type of the constructor as a syntactic tuple:
4334!   change "C of <ty>"
4335!   to     "C of <ty_1> * <ty_2>"
4336- ! Toplevel input:
4337!   YL:sig structure Y: G end;
4338!   ^^^^^^^^^^^^^^^^^^^^^^^^^
4339! Signature mismatch: the module does not match the signature ...
4340! Status mismatch: constructor  Y.C
4341! is specified as a constructor carrying 2 fields of a tuple in the signature
4342!   con C : a * b -> d
4343! but declared as a constructor carrying a tuple with 2 fields in the module
4344!   con C : (a * b) -> d
4345! EITHER: edit the specification to match the declaration:
4346! - in the signature, enclose the argument type of the constructor in parentheses:
4347!   change "C of  <ty_1> * <ty_2>"
4348!   to     "C of (<ty_1> * <ty_2>)"
4349! OR: edit the declaration to match the specification:
4350! - in the module, re-express the argument type of the constructor as a syntactic tuple:
4351!   change "C of <ty>"
4352!   to     "C of <ty_1> * <ty_2>"
4353- ! Toplevel input:
4354!   L_YL:functor(L:L)->sig structure Y: G end;
4355!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4356! Signature mismatch: the module does not match the signature ...
4357! Status mismatch: constructor  Y.C of the range
4358! is specified as a constructor carrying 2 fields of a tuple in the signature
4359!   con C : a * b -> d
4360! but declared as a constructor carrying a tuple with 2 fields in the module
4361!   con C : (a * b) -> d
4362! EITHER: edit the specification to match the declaration:
4363! - in the signature, enclose the argument type of the constructor in parentheses:
4364!   change "C of  <ty_1> * <ty_2>"
4365!   to     "C of (<ty_1> * <ty_2>)"
4366! OR: edit the declaration to match the specification:
4367! - in the module, re-express the argument type of the constructor as a syntactic tuple:
4368!   change "C of <ty>"
4369!   to     "C of <ty_1> * <ty_2>"
4370- ! Toplevel input:
4371!   YG_L:functor(YL:sig structure Y: L end)->L;
4372!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4373! Signature mismatch: the module does not match the signature ...
4374! Status mismatch: constructor  Y.C of the domain
4375! is specified as a constructor carrying 2 fields of a tuple in the module
4376!   con C : a * b -> d
4377! but declared as a constructor carrying a tuple with 2 fields in the signature
4378!   con C : (a * b) -> d
4379! EITHER: edit the specification to match the declaration:
4380! - in the module, enclose the argument type of the constructor in parentheses:
4381!   change "C of  <ty_1> * <ty_2>"
4382!   to     "C of (<ty_1> * <ty_2>)"
4383! OR: edit the declaration to match the specification:
4384! - in the signature, re-express the argument type of the constructor as a syntactic tuple:
4385!   change "C of <ty>"
4386!   to     "C of <ty_1> * <ty_2>"
4387- ! Toplevel input:
4388!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
4389!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4390! Signature mismatch: the module does not match the signature ...
4391! Status mismatch: constructor  Y.C of the domain of the range
4392! is specified as a constructor carrying 2 fields of a tuple in the module
4393!   con C : a * b -> d
4394! but declared as a constructor carrying a tuple with 2 fields in the signature
4395!   con C : (a * b) -> d
4396! EITHER: edit the specification to match the declaration:
4397! - in the module, enclose the argument type of the constructor in parentheses:
4398!   change "C of  <ty_1> * <ty_2>"
4399!   to     "C of (<ty_1> * <ty_2>)"
4400! OR: edit the declaration to match the specification:
4401! - in the signature, re-express the argument type of the constructor as a syntactic tuple:
4402!   change "C of <ty>"
4403!   to     "C of <ty_1> * <ty_2>"
4404- ! Toplevel input:
4405!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
4406!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4407! Signature mismatch: the module does not match the signature ...
4408! Status mismatch: constructor  Y.C of the domain of the range of F
4409! is specified as a constructor carrying 2 fields of a tuple in the module
4410!   con C : a * b -> d
4411! but declared as a constructor carrying a tuple with 2 fields in the signature
4412!   con C : (a * b) -> d
4413! EITHER: edit the specification to match the declaration:
4414! - in the module, enclose the argument type of the constructor in parentheses:
4415!   change "C of  <ty_1> * <ty_2>"
4416!   to     "C of (<ty_1> * <ty_2>)"
4417! OR: edit the declaration to match the specification:
4418! - in the signature, re-express the argument type of the constructor as a syntactic tuple:
4419!   change "C of <ty>"
4420!   to     "C of <ty_1> * <ty_2>"
4421- > signature G =
4422  /\=d.
4423    {datatype d = (d,{con C : {a : a} -> d, con D : d}),
4424     con C : {a : a} -> d,
4425     con D : d}
4426- > signature L =
4427  /\=d.
4428    {datatype d = (d,{con C : ({a : a}) -> d, con D : d}),
4429     con C : ({a : a}) -> d,
4430     con D : d}
4431- ! Toplevel input:
4432!   L:G;
4433!   ^^^
4434! Signature mismatch: the module does not match the signature ...
4435! Status mismatch: constructor  C
4436! is specified as a constructor carrying one field of a record in the signature
4437!   con C : {a : a} -> d
4438! but declared as a constructor carrying a record with one field in the module
4439!   con C : ({a : a}) -> d
4440! EITHER: edit the specification to match the declaration:
4441! - in the signature, enclose the argument type of the constructor in parentheses:
4442!   change "C of  {a : <ty_1>}"
4443!   to     "C of ({a : <ty_1>})"
4444! OR: edit the declaration to match the specification:
4445! - in the module, re-express the argument type of the constructor as a syntactic record:
4446!   change "C of <ty>"
4447!   to     "C of {a : <ty_1>}"
4448- ! Toplevel input:
4449!   LL:functor(L:L)->G;
4450!   ^^^^^^^^^^^^^^^^^^
4451! Signature mismatch: the module does not match the signature ...
4452! Status mismatch: constructor  C of the range
4453! is specified as a constructor carrying one field of a record in the signature
4454!   con C : {a : a} -> d
4455! but declared as a constructor carrying a record with one field in the module
4456!   con C : ({a : a}) -> d
4457! EITHER: edit the specification to match the declaration:
4458! - in the signature, enclose the argument type of the constructor in parentheses:
4459!   change "C of  {a : <ty_1>}"
4460!   to     "C of ({a : <ty_1>})"
4461! OR: edit the declaration to match the specification:
4462! - in the module, re-express the argument type of the constructor as a syntactic record:
4463!   change "C of <ty>"
4464!   to     "C of {a : <ty_1>}"
4465- ! Toplevel input:
4466!   GL:functor(L:L)->L;
4467!   ^^^^^^^^^^^^^^^^^^
4468! Signature mismatch: the module does not match the signature ...
4469! Status mismatch: constructor  C of the domain
4470! is specified as a constructor carrying one field of a record in the module
4471!   con C : {a : a} -> d
4472! but declared as a constructor carrying a record with one field in the signature
4473!   con C : ({a : a}) -> d
4474! EITHER: edit the specification to match the declaration:
4475! - in the module, enclose the argument type of the constructor in parentheses:
4476!   change "C of  {a : <ty_1>}"
4477!   to     "C of ({a : <ty_1>})"
4478! OR: edit the declaration to match the specification:
4479! - in the signature, re-express the argument type of the constructor as a syntactic record:
4480!   change "C of <ty>"
4481!   to     "C of {a : <ty_1>}"
4482- ! Toplevel input:
4483!   YL:sig structure Y: G end;
4484!   ^^^^^^^^^^^^^^^^^^^^^^^^^
4485! Signature mismatch: the module does not match the signature ...
4486! Status mismatch: constructor  Y.C
4487! is specified as a constructor carrying one field of a record in the signature
4488!   con C : {a : a} -> d
4489! but declared as a constructor carrying a record with one field in the module
4490!   con C : ({a : a}) -> d
4491! EITHER: edit the specification to match the declaration:
4492! - in the signature, enclose the argument type of the constructor in parentheses:
4493!   change "C of  {a : <ty_1>}"
4494!   to     "C of ({a : <ty_1>})"
4495! OR: edit the declaration to match the specification:
4496! - in the module, re-express the argument type of the constructor as a syntactic record:
4497!   change "C of <ty>"
4498!   to     "C of {a : <ty_1>}"
4499- ! Toplevel input:
4500!   L_YL:functor(L:L)->sig structure Y: G end;
4501!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4502! Signature mismatch: the module does not match the signature ...
4503! Status mismatch: constructor  Y.C of the range
4504! is specified as a constructor carrying one field of a record in the signature
4505!   con C : {a : a} -> d
4506! but declared as a constructor carrying a record with one field in the module
4507!   con C : ({a : a}) -> d
4508! EITHER: edit the specification to match the declaration:
4509! - in the signature, enclose the argument type of the constructor in parentheses:
4510!   change "C of  {a : <ty_1>}"
4511!   to     "C of ({a : <ty_1>})"
4512! OR: edit the declaration to match the specification:
4513! - in the module, re-express the argument type of the constructor as a syntactic record:
4514!   change "C of <ty>"
4515!   to     "C of {a : <ty_1>}"
4516- ! Toplevel input:
4517!   YG_L:functor(YL:sig structure Y: L end)->L;
4518!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4519! Signature mismatch: the module does not match the signature ...
4520! Status mismatch: constructor  Y.C of the domain
4521! is specified as a constructor carrying one field of a record in the module
4522!   con C : {a : a} -> d
4523! but declared as a constructor carrying a record with one field in the signature
4524!   con C : ({a : a}) -> d
4525! EITHER: edit the specification to match the declaration:
4526! - in the module, enclose the argument type of the constructor in parentheses:
4527!   change "C of  {a : <ty_1>}"
4528!   to     "C of ({a : <ty_1>})"
4529! OR: edit the declaration to match the specification:
4530! - in the signature, re-express the argument type of the constructor as a syntactic record:
4531!   change "C of <ty>"
4532!   to     "C of {a : <ty_1>}"
4533- ! Toplevel input:
4534!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
4535!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4536! Signature mismatch: the module does not match the signature ...
4537! Status mismatch: constructor  Y.C of the domain of the range
4538! is specified as a constructor carrying one field of a record in the module
4539!   con C : {a : a} -> d
4540! but declared as a constructor carrying a record with one field in the signature
4541!   con C : ({a : a}) -> d
4542! EITHER: edit the specification to match the declaration:
4543! - in the module, enclose the argument type of the constructor in parentheses:
4544!   change "C of  {a : <ty_1>}"
4545!   to     "C of ({a : <ty_1>})"
4546! OR: edit the declaration to match the specification:
4547! - in the signature, re-express the argument type of the constructor as a syntactic record:
4548!   change "C of <ty>"
4549!   to     "C of {a : <ty_1>}"
4550- ! Toplevel input:
4551!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
4552!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4553! Signature mismatch: the module does not match the signature ...
4554! Status mismatch: constructor  Y.C of the domain of the range of F
4555! is specified as a constructor carrying one field of a record in the module
4556!   con C : {a : a} -> d
4557! but declared as a constructor carrying a record with one field in the signature
4558!   con C : ({a : a}) -> d
4559! EITHER: edit the specification to match the declaration:
4560! - in the module, enclose the argument type of the constructor in parentheses:
4561!   change "C of  {a : <ty_1>}"
4562!   to     "C of ({a : <ty_1>})"
4563! OR: edit the declaration to match the specification:
4564! - in the signature, re-express the argument type of the constructor as a syntactic record:
4565!   change "C of <ty>"
4566!   to     "C of {a : <ty_1>}"
4567- > signature G =
4568  /\=d.
4569    {datatype d = (d,{con C : {a : a, b : b} -> d, con D : d}),
4570     con C : {a : a, b : b} -> d,
4571     con D : d}
4572- > signature L =
4573  /\=d.
4574    {datatype d = (d,{con C : ({a : a, b : b}) -> d, con D : d}),
4575     con C : ({a : a, b : b}) -> d,
4576     con D : d}
4577- ! Toplevel input:
4578!   L:G;
4579!   ^^^
4580! Signature mismatch: the module does not match the signature ...
4581! Status mismatch: constructor  C
4582! is specified as a constructor carrying 2 fields of a record in the signature
4583!   con C : {a : a, b : b} -> d
4584! but declared as a constructor carrying a record with 2 fields in the module
4585!   con C : ({a : a, b : b}) -> d
4586! EITHER: edit the specification to match the declaration:
4587! - in the signature, enclose the argument type of the constructor in parentheses:
4588!   change "C of  {a : <ty_1>, b : <ty_2>}"
4589!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4590! OR: edit the declaration to match the specification:
4591! - in the module, re-express the argument type of the constructor as a syntactic record:
4592!   change "C of <ty>"
4593!   to     "C of {a : <ty_1>, b : <ty_2>}"
4594- ! Toplevel input:
4595!   LL:functor(L:L)->G;
4596!   ^^^^^^^^^^^^^^^^^^
4597! Signature mismatch: the module does not match the signature ...
4598! Status mismatch: constructor  C of the range
4599! is specified as a constructor carrying 2 fields of a record in the signature
4600!   con C : {a : a, b : b} -> d
4601! but declared as a constructor carrying a record with 2 fields in the module
4602!   con C : ({a : a, b : b}) -> d
4603! EITHER: edit the specification to match the declaration:
4604! - in the signature, enclose the argument type of the constructor in parentheses:
4605!   change "C of  {a : <ty_1>, b : <ty_2>}"
4606!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4607! OR: edit the declaration to match the specification:
4608! - in the module, re-express the argument type of the constructor as a syntactic record:
4609!   change "C of <ty>"
4610!   to     "C of {a : <ty_1>, b : <ty_2>}"
4611- ! Toplevel input:
4612!   GL:functor(L:L)->L;
4613!   ^^^^^^^^^^^^^^^^^^
4614! Signature mismatch: the module does not match the signature ...
4615! Status mismatch: constructor  C of the domain
4616! is specified as a constructor carrying 2 fields of a record in the module
4617!   con C : {a : a, b : b} -> d
4618! but declared as a constructor carrying a record with 2 fields in the signature
4619!   con C : ({a : a, b : b}) -> d
4620! EITHER: edit the specification to match the declaration:
4621! - in the module, enclose the argument type of the constructor in parentheses:
4622!   change "C of  {a : <ty_1>, b : <ty_2>}"
4623!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4624! OR: edit the declaration to match the specification:
4625! - in the signature, re-express the argument type of the constructor as a syntactic record:
4626!   change "C of <ty>"
4627!   to     "C of {a : <ty_1>, b : <ty_2>}"
4628- ! Toplevel input:
4629!   YL:sig structure Y: G end;
4630!   ^^^^^^^^^^^^^^^^^^^^^^^^^
4631! Signature mismatch: the module does not match the signature ...
4632! Status mismatch: constructor  Y.C
4633! is specified as a constructor carrying 2 fields of a record in the signature
4634!   con C : {a : a, b : b} -> d
4635! but declared as a constructor carrying a record with 2 fields in the module
4636!   con C : ({a : a, b : b}) -> d
4637! EITHER: edit the specification to match the declaration:
4638! - in the signature, enclose the argument type of the constructor in parentheses:
4639!   change "C of  {a : <ty_1>, b : <ty_2>}"
4640!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4641! OR: edit the declaration to match the specification:
4642! - in the module, re-express the argument type of the constructor as a syntactic record:
4643!   change "C of <ty>"
4644!   to     "C of {a : <ty_1>, b : <ty_2>}"
4645- ! Toplevel input:
4646!   L_YL:functor(L:L)->sig structure Y: G end;
4647!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4648! Signature mismatch: the module does not match the signature ...
4649! Status mismatch: constructor  Y.C of the range
4650! is specified as a constructor carrying 2 fields of a record in the signature
4651!   con C : {a : a, b : b} -> d
4652! but declared as a constructor carrying a record with 2 fields in the module
4653!   con C : ({a : a, b : b}) -> d
4654! EITHER: edit the specification to match the declaration:
4655! - in the signature, enclose the argument type of the constructor in parentheses:
4656!   change "C of  {a : <ty_1>, b : <ty_2>}"
4657!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4658! OR: edit the declaration to match the specification:
4659! - in the module, re-express the argument type of the constructor as a syntactic record:
4660!   change "C of <ty>"
4661!   to     "C of {a : <ty_1>, b : <ty_2>}"
4662- ! Toplevel input:
4663!   YG_L:functor(YL:sig structure Y: L end)->L;
4664!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4665! Signature mismatch: the module does not match the signature ...
4666! Status mismatch: constructor  Y.C of the domain
4667! is specified as a constructor carrying 2 fields of a record in the module
4668!   con C : {a : a, b : b} -> d
4669! but declared as a constructor carrying a record with 2 fields in the signature
4670!   con C : ({a : a, b : b}) -> d
4671! EITHER: edit the specification to match the declaration:
4672! - in the module, enclose the argument type of the constructor in parentheses:
4673!   change "C of  {a : <ty_1>, b : <ty_2>}"
4674!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4675! OR: edit the declaration to match the specification:
4676! - in the signature, re-express the argument type of the constructor as a syntactic record:
4677!   change "C of <ty>"
4678!   to     "C of {a : <ty_1>, b : <ty_2>}"
4679- ! Toplevel input:
4680!   L_YG_L:functor(L:L)->functor(YL:sig structure Y:L end)->L;
4681!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4682! Signature mismatch: the module does not match the signature ...
4683! Status mismatch: constructor  Y.C of the domain of the range
4684! is specified as a constructor carrying 2 fields of a record in the module
4685!   con C : {a : a, b : b} -> d
4686! but declared as a constructor carrying a record with 2 fields in the signature
4687!   con C : ({a : a, b : b}) -> d
4688! EITHER: edit the specification to match the declaration:
4689! - in the module, enclose the argument type of the constructor in parentheses:
4690!   change "C of  {a : <ty_1>, b : <ty_2>}"
4691!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4692! OR: edit the declaration to match the specification:
4693! - in the signature, re-express the argument type of the constructor as a syntactic record:
4694!   change "C of <ty>"
4695!   to     "C of {a : <ty_1>, b : <ty_2>}"
4696- ! Toplevel input:
4697!   FLYGL:sig functor F: functor(L:L)->functor(YL:sig structure Y:L end)->L end;
4698!   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4699! Signature mismatch: the module does not match the signature ...
4700! Status mismatch: constructor  Y.C of the domain of the range of F
4701! is specified as a constructor carrying 2 fields of a record in the module
4702!   con C : {a : a, b : b} -> d
4703! but declared as a constructor carrying a record with 2 fields in the signature
4704!   con C : ({a : a, b : b}) -> d
4705! EITHER: edit the specification to match the declaration:
4706! - in the module, enclose the argument type of the constructor in parentheses:
4707!   change "C of  {a : <ty_1>, b : <ty_2>}"
4708!   to     "C of ({a : <ty_1>, b : <ty_2>})"
4709! OR: edit the declaration to match the specification:
4710! - in the signature, re-express the argument type of the constructor as a syntactic record:
4711!   change "C of <ty>"
4712!   to     "C of {a : <ty_1>, b : <ty_2>}"
4713-
4714Moscow ML version 2.01a (January 2004)
4715Enter `quit();' to quit.
4716- > signature S = /\t.{type t = t, type v = t}
4717- > New type names: t
4718  structure X : {type t = t, type v = t}
4719- > New type names: t/1
4720  structure Y : {type t = t/1, type v = t/1}
4721- > New type names: t/2
4722  structure Z : {type t = t/2, type v = t/2}
4723- > functor F :
4724  !t/3.{type t = t/3, type v = t/3}->?t/4.{type t = t/4, type v = t/4}
4725- > functor G :
4726  !t/3.{type t = t/3, type v = t/3}->?t/4 t/5 t/6.{type t = t/6, type v = t/6}
4727- > functor H :
4728  !t/3.{type t = t/3, type v = t/3}->?t/4.{type t = t/4, type v = t/4}
4729- > signature LR_TABLE =
4730  /\=pairlist.
4731    {datatype ('a, 'b) pairlist =
4732       (('a, 'b) pairlist,
4733        {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4734         con ('a, 'b) PAIR :
4735           'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4736     con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4737     con ('a, 'b) PAIR : 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}
4738- > signature TOKEN =
4739  /\=pairlist.
4740    {structure LrTable :
4741       {datatype ('a, 'b) pairlist =
4742          (('a, 'b) pairlist,
4743           {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4744            con ('a, 'b) PAIR :
4745              'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4746        con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4747        con ('a, 'b) PAIR : 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}}
4748- > signature LR_PARSER =
4749  /\=pairlist.
4750    {structure LrTable :
4751       {datatype ('a, 'b) pairlist =
4752          (('a, 'b) pairlist,
4753           {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4754            con ('a, 'b) PAIR :
4755              'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4756        con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4757        con ('a, 'b) PAIR : 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist},
4758     structure Token :
4759       {structure LrTable :
4760          {datatype ('a, 'b) pairlist =
4761             (('a, 'b) pairlist,
4762              {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4763               con ('a, 'b) PAIR :
4764                 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4765           con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4766           con ('a, 'b) PAIR :
4767             'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}}}
4768- > signature PARSER_DATA =
4769  /\=pairlist.
4770    {structure LrTable :
4771       {datatype ('a, 'b) pairlist =
4772          (('a, 'b) pairlist,
4773           {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4774            con ('a, 'b) PAIR :
4775              'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4776        con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4777        con ('a, 'b) PAIR : 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist},
4778     structure Token :
4779       {structure LrTable :
4780          {datatype ('a, 'b) pairlist =
4781             (('a, 'b) pairlist,
4782              {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4783               con ('a, 'b) PAIR :
4784                 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4785           con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4786           con ('a, 'b) PAIR :
4787             'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}}}
4788- > signature PARSER =
4789  /\=pairlist.
4790    {structure Token :
4791       {structure LrTable :
4792          {datatype ('a, 'b) pairlist =
4793             (('a, 'b) pairlist,
4794              {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4795               con ('a, 'b) PAIR :
4796                 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4797           con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4798           con ('a, 'b) PAIR :
4799             'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}}}
4800- > functor Join :
4801  !=pairlist.
4802   {structure ParserData :
4803      {structure LrTable :
4804         {datatype ('a, 'b) pairlist =
4805            (('a, 'b) pairlist,
4806             {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4807              con ('a, 'b) PAIR :
4808                'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4809          con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4810          con ('a, 'b) PAIR :
4811            'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist},
4812       structure Token :
4813         {structure LrTable :
4814            {datatype ('a, 'b) pairlist =
4815               (('a, 'b) pairlist,
4816                {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4817                 con ('a, 'b) PAIR :
4818                   'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4819             con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4820             con ('a, 'b) PAIR :
4821               'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}}},
4822    structure LrParser :
4823      {structure LrTable :
4824         {datatype ('a, 'b) pairlist =
4825            (('a, 'b) pairlist,
4826             {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4827              con ('a, 'b) PAIR :
4828                'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4829          con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4830          con ('a, 'b) PAIR :
4831            'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist},
4832       structure Token :
4833         {structure LrTable :
4834            {datatype ('a, 'b) pairlist =
4835               (('a, 'b) pairlist,
4836                {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4837                 con ('a, 'b) PAIR :
4838                   'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4839             con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4840             con ('a, 'b) PAIR :
4841               'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}}}}->
4842       {structure Token :
4843          {structure LrTable :
4844             {datatype ('a, 'b) pairlist =
4845                (('a, 'b) pairlist,
4846                 {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4847                  con ('a, 'b) PAIR :
4848                    'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4849              con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4850              con ('a, 'b) PAIR :
4851                'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}}}
4852- > New type names: =pairlist
4853  structure LrTable :
4854  {datatype ('a, 'b) pairlist =
4855     (('a, 'b) pairlist,
4856      {con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4857       con ('a, 'b) PAIR : 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}),
4858   con ('a, 'b) EMPTY : ('a, 'b) pairlist,
4859   con ('a, 'b) PAIR : 'a * 'b * ('a, 'b) pairlist -> ('a, 'b) pairlist}
4860- > New type names: =pairlist/1
4861  structure LrParser :
4862  {structure LrTable :
4863     {datatype ('a, 'b) pairlist =
4864        (('a, 'b) pairlist/1,
4865         {con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4866          con ('a, 'b) PAIR :
4867            'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}),
4868      con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4869      con ('a, 'b) PAIR :
4870        'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1},
4871   structure Token :
4872     {structure LrTable :
4873        {datatype ('a, 'b) pairlist =
4874           (('a, 'b) pairlist/1,
4875            {con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4876             con ('a, 'b) PAIR :
4877               'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}),
4878         con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4879         con ('a, 'b) PAIR :
4880           'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}}}
4881- > signature Fol_LRVALS =
4882  /\=pairlist/2.
4883    {structure ParserData :
4884       {structure LrTable :
4885          {datatype ('a, 'b) pairlist =
4886             (('a, 'b) pairlist/2,
4887              {con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4888               con ('a, 'b) PAIR :
4889                 'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}),
4890           con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4891           con ('a, 'b) PAIR :
4892             'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2},
4893        structure Token :
4894          {structure LrTable :
4895             {datatype ('a, 'b) pairlist =
4896                (('a, 'b) pairlist/2,
4897                 {con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4898                  con ('a, 'b) PAIR :
4899                    'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}),
4900              con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4901              con ('a, 'b) PAIR :
4902                'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}}}}
4903- > functor FolLrValsFun :
4904  !=pairlist/2.
4905   {structure Token :
4906      {structure LrTable :
4907         {datatype ('a, 'b) pairlist =
4908            (('a, 'b) pairlist/2,
4909             {con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4910              con ('a, 'b) PAIR :
4911                'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}),
4912          con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4913          con ('a, 'b) PAIR :
4914            'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}}}->
4915       {structure ParserData :
4916          {structure LrTable :
4917             {datatype ('a, 'b) pairlist =
4918                (('a, 'b) pairlist/2,
4919                 {con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4920                  con ('a, 'b) PAIR :
4921                    'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}),
4922              con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4923              con ('a, 'b) PAIR :
4924                'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2},
4925           structure Token :
4926             {structure LrTable :
4927                {datatype ('a, 'b) pairlist =
4928                   (('a, 'b) pairlist/2,
4929                    {con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4930                     con ('a, 'b) PAIR :
4931                       'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}),
4932                 con ('a, 'b) EMPTY : ('a, 'b) pairlist/2,
4933                 con ('a, 'b) PAIR :
4934                   'a * 'b * ('a, 'b) pairlist/2 -> ('a, 'b) pairlist/2}}}}
4935- > structure FolLrVals :
4936  {structure ParserData :
4937     {structure LrTable :
4938        {datatype ('a, 'b) pairlist =
4939           (('a, 'b) pairlist/1,
4940            {con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4941             con ('a, 'b) PAIR :
4942               'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}),
4943         con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4944         con ('a, 'b) PAIR :
4945           'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1},
4946      structure Token :
4947        {structure LrTable :
4948           {datatype ('a, 'b) pairlist =
4949              (('a, 'b) pairlist/1,
4950               {con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4951                con ('a, 'b) PAIR :
4952                  'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}),
4953            con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4954            con ('a, 'b) PAIR :
4955              'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}}}}
4956- > structure FolParser :
4957  {structure Token :
4958     {structure LrTable :
4959        {datatype ('a, 'b) pairlist =
4960           (('a, 'b) pairlist/1,
4961            {con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4962             con ('a, 'b) PAIR :
4963               'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}),
4964         con ('a, 'b) EMPTY : ('a, 'b) pairlist/1,
4965         con ('a, 'b) PAIR :
4966           'a * 'b * ('a, 'b) pairlist/1 -> ('a, 'b) pairlist/1}}}
4967-
4968Moscow ML version 2.01a (January 2004)
4969Enter `quit();' to quit.
4970- > New type names: =t
4971  datatype t = (t,{con C : t -> t})
4972  con C = fn : t -> t
4973- > New type names: =u
4974  datatype 'a u = ('a u,{con 'a D : 'a -> 'a u})
4975  con 'a D = fn : 'a -> 'a u
4976- > New type names: =v
4977  datatype ('a, 'b) v = (('a, 'b) v,{con ('a, 'b) E : 'a * 'b -> ('a, 'b) v})
4978  con ('a, 'b) E = fn : 'a * 'b -> ('a, 'b) v
4979- > signature S =
4980  /\=t/1 =u/1 =v/1.
4981    {datatype t = (t/1,{con C : t/1 -> t/1}),
4982     con C : t/1 -> t/1,
4983     datatype 'a u = ('a u/1,{con 'a D : 'a -> 'a u/1}),
4984     con 'a D : 'a -> 'a u/1,
4985     datatype ('a, 'b) v =
4986       (('a, 'b) v/1,{con ('a, 'b) E : 'a * 'b -> ('a, 'b) v/1}),
4987     con ('a, 'b) E : 'a * 'b -> ('a, 'b) v/1}
4988- > signature Ok =
4989  {datatype t = (t,{con C : t -> t}),
4990   con C : t -> t,
4991   datatype 'a u = ('a u,{con 'a D : 'a -> 'a u}),
4992   con 'a D : 'a -> 'a u,
4993   datatype ('a, 'b) v = (('a, 'b) v,{con ('a, 'b) E : 'a * 'b -> ('a, 'b) v}),
4994   con ('a, 'b) E : 'a * 'b -> ('a, 'b) v}
4995- ! Toplevel input:
4996! signature FailWeirdButValidSML = S where type t = int;
4997!                                          ^^^^^^^^^^^^
4998! Illegal where constraint: the type constructor t
4999! is specified as a datatype
5000! but its constraint is not a datatype
5001- ! Toplevel input:
5002! signature Fail = S where type t = int * int;
5003!                          ^^^^^^^^^^^^^^^^^^
5004! Illegal where constraint: the type constructor t
5005! is specified as a datatype
5006! but its constraint is not a datatype
5007- ! Toplevel input:
5008! signature FailWeirdButValidSML = S where type 'a u = 'a list;
5009!                                          ^^^^^^^^^^^^^^^^^^^
5010! Illegal where constraint: the datatype constructor u
5011! cannot be constrained in this way because
5012! the constraint's constructor environment does not match the specification's constructor environment
5013! Datatype mismatch: type constructor u
5014! is specified as the datatype
5015!   datatype 'a u = ('a list,{con 'a D : 'a -> 'a list})
5016! in the specification
5017! but declared as the different datatype
5018!   datatype 'a u =
5019  ('a list,{con 'a nil : 'a list, con 'a :: : 'a * 'a list -> 'a list})
5020! in the constraint
5021! The datatypes should agree on the names and the order of value constructors
5022- ! Toplevel input:
5023! signature Fail = S where type 'a u = int u;
5024!                          ^^^^^^^^^^^^^^^^^
5025! Illegal where constraint: the type constructor u
5026! is specified as a datatype
5027! but its constraint is not a datatype
5028- ! Toplevel input:
5029! signature Fail = S where type 'a u = 'a * 'a;
5030!                          ^^^^^^^^^^^^^^^^^^^
5031! Illegal where constraint: the type constructor u
5032! is specified as a datatype
5033! but its constraint is not a datatype
5034- > New type names: =w
5035  datatype ('a, 'b) w = (('a, 'b) w,{con ('a, 'b) W : ('a, 'b) w})
5036  con ('a, 'b) W = W : ('a, 'b) w
5037- > type ('a, 'b, 'c) x = ('a, 'b) w
5038- > type ('a, 'b) y = ('a, 'a) w
5039- ! Toplevel input:
5040! signature FailWeirdButValidSML = S where type ('a,'b) v = ('a,'b) w;
5041!                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
5042! Illegal where constraint: the datatype constructor v
5043! cannot be constrained in this way because
5044! the constraint's constructor environment does not match the specification's constructor environment
5045! Datatype mismatch: type constructor v
5046! is specified as the datatype
5047!   datatype ('a, 'b) v = (('a, 'b) w,{con ('a, 'b) E : 'a * 'b -> ('a, 'b) w})
5048! in the specification
5049! but declared as the different datatype
5050!   datatype ('a, 'b) v = (('a, 'b) w,{con ('a, 'b) W : ('a, 'b) w})
5051! in the constraint
5052! The datatypes should agree on the names and the order of value constructors
5053- ! Toplevel input:
5054! signature FailWeirdButValidSML = S where type ('a,'b) v = ('a,'b,int) x;
5055!                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5056! Illegal where constraint: the datatype constructor v
5057! cannot be constrained in this way because
5058! the constraint's constructor environment does not match the specification's constructor environment
5059! Datatype mismatch: type constructor v
5060! is specified as the datatype
5061!   datatype ('a, 'b) v = (('a, 'b) w,{con ('a, 'b) E : 'a * 'b -> ('a, 'b) w})
5062! in the specification
5063! but declared as the different datatype
5064!   datatype ('a, 'b) v = (('a, 'b) w,{con ('a, 'b) W : ('a, 'b) w})
5065! in the constraint
5066! The datatypes should agree on the names and the order of value constructors
5067- ! Toplevel input:
5068! signature Fail = S where type ('a,'b) v = ('a,'a)w;
5069!                          ^^^^^^^^^^^^^^^^^^^^^^^^^
5070! Illegal where constraint: the type constructor v
5071! is specified as a datatype
5072! but its constraint is not a datatype
5073- ! Toplevel input:
5074! signature Fail = S where type ('a,'b) v = ('a,'a)w;
5075!                          ^^^^^^^^^^^^^^^^^^^^^^^^^
5076! Illegal where constraint: the type constructor v
5077! is specified as a datatype
5078! but its constraint is not a datatype
5079- ! Toplevel input:
5080! signature Fail = S where type ('a,'b) v = ('a,'b)y;
5081!                          ^^^^^^^^^^^^^^^^^^^^^^^^^
5082! Illegal where constraint: the type constructor v
5083! is specified as a datatype
5084! but its constraint is not a datatype
5085- > New type names: =t/1
5086  datatype t = (t/1,{con C : bool -> t/1, con D : int -> t/1})
5087  con C = fn : bool -> t/1
5088  con D = fn : int -> t/1
5089- ! Toplevel input:
5090! signature Fail = sig datatype u = C of bool end where type u = t;
5091!                                                       ^^^^^^^^^^
5092! Illegal where constraint: the datatype constructor u
5093! cannot be constrained in this way because
5094! the constraint's constructor environment does not match the specification's constructor environment
5095! Datatype mismatch: type constructor u
5096! is specified as the datatype
5097!   datatype u = (t/1,{con C : bool -> t/1})
5098! in the specification
5099! but declared as the different datatype
5100!   datatype u = (t/1,{con C : bool -> t/1, con D : int -> t/1})
5101! in the constraint
5102! The datatypes should agree on the names and the order of value constructors
5103- ! Toplevel input:
5104! signature Fail = sig datatype u = C of bool | D of bool end where type u = t;
5105!                                                                   ^^^^^^^^^^
5106! Illegal where constraint: the datatype constructor u
5107! cannot be constrained in this way because
5108! the constraint's constructor environment does not match the specification's constructor environment
5109! Scheme mismatch: value identifier D
5110! is specified with type scheme
5111!   con D : bool -> t/1
5112! in the specification
5113! but its declaration has the unrelated type scheme
5114!   con D : int -> t/1
5115! in the constraint
5116! The declared type scheme should be at least as general as the specified type scheme
5117- ! Toplevel input:
5118! signature Fail = sig datatype u = C of bool | D of int end where type u = int;
5119!                                                                  ^^^^^^^^^^^^
5120! Illegal where constraint: the type constructor u
5121! is specified as a datatype
5122! but its constraint is not a datatype
5123- > signature OK =
5124  {datatype u = (t/1,{con C : bool -> t/1, con D : int -> t/1}),
5125   con C : bool -> t/1,
5126   con D : int -> t/1}
5127- > type s = t/1
5128- ! Toplevel input:
5129! signature Fail = sig datatype u = C of bool end where type u = s;
5130!                                                       ^^^^^^^^^^
5131! Illegal where constraint: the datatype constructor u
5132! cannot be constrained in this way because
5133! the constraint's constructor environment does not match the specification's constructor environment
5134! Datatype mismatch: type constructor u
5135! is specified as the datatype
5136!   datatype u = (t/1,{con C : bool -> t/1})
5137! in the specification
5138! but declared as the different datatype
5139!   datatype u = (t/1,{con C : bool -> t/1, con D : int -> t/1})
5140! in the constraint
5141! The datatypes should agree on the names and the order of value constructors
5142- ! Toplevel input:
5143! signature Fail = sig datatype u = C of bool | D of bool end where type u = s;
5144!                                                                   ^^^^^^^^^^
5145! Illegal where constraint: the datatype constructor u
5146! cannot be constrained in this way because
5147! the constraint's constructor environment does not match the specification's constructor environment
5148! Scheme mismatch: value identifier D
5149! is specified with type scheme
5150!   con D : bool -> t/1
5151! in the specification
5152! but its declaration has the unrelated type scheme
5153!   con D : int -> t/1
5154! in the constraint
5155! The declared type scheme should be at least as general as the specified type scheme
5156- > signature OK =
5157  {datatype u = (t/1,{con C : bool -> t/1, con D : int -> t/1}),
5158   con C : bool -> t/1,
5159   con D : int -> t/1}
5160- ! Toplevel input:
5161! signature Fail = sig datatype u = C of bool type v = u end where type v = t;
5162!                                                                  ^^^^^^^^^^
5163! Illegal where constraint: the datatype constructor v
5164! cannot be constrained in this way because
5165! the constraint's constructor environment does not match the specification's constructor environment
5166! Datatype mismatch: type constructor v
5167! is specified as the datatype
5168!   datatype v = (t/1,{con C : bool -> t/1})
5169! in the specification
5170! but declared as the different datatype
5171!   datatype v = (t/1,{con C : bool -> t/1, con D : int -> t/1})
5172! in the constraint
5173! The datatypes should agree on the names and the order of value constructors
5174- ! Toplevel input:
5175! signature Fail = sig datatype u = C of bool | D of bool type v = u end where type v = t;
5176!                                                                              ^^^^^^^^^^
5177! Illegal where constraint: the datatype constructor v
5178! cannot be constrained in this way because
5179! the constraint's constructor environment does not match the specification's constructor environment
5180! Scheme mismatch: value identifier D
5181! is specified with type scheme
5182!   con D : bool -> t/1
5183! in the specification
5184! but its declaration has the unrelated type scheme
5185!   con D : int -> t/1
5186! in the constraint
5187! The declared type scheme should be at least as general as the specified type scheme
5188- > signature OK =
5189  {datatype u = (u/1,{con C : bool -> u/1, con D : int -> u/1}),
5190   con C : bool -> u/1,
5191   con D : int -> u/1,
5192   type v = u/1}
5193- ! Toplevel input:
5194!       signature Fail = sig datatype u = C of bool end where type u = t;
5195!                                                             ^^^^^^^^^^
5196! Illegal where constraint: the datatype constructor u
5197! cannot be constrained in this way because
5198! the constraint's constructor environment does not match the specification's constructor environment
5199! Scheme mismatch: value identifier C
5200! is specified with type scheme
5201!   con C : bool -> t/2
5202! in the specification
5203! but its declaration has the unrelated type scheme
5204!   con C : int -> t/2
5205! in the constraint
5206! The declared type scheme should be at least as general as the specified type scheme
5207-
5208Moscow ML version 2.01a (January 2004)
5209Enter `quit();' to quit.
5210[opening file "test.sml"]
5211> structure Real :
5212  {type real = real,
5213   val != : real * real -> bool,
5214   val * : real * real -> real,
5215   val + : real * real -> real,
5216   val - : real * real -> real,
5217   val / : real * real -> real,
5218   val < : real * real -> bool,
5219   val <= : real * real -> bool,
5220   val == : real * real -> bool,
5221   val > : real * real -> bool,
5222   val >= : real * real -> bool,
5223   val ?= : real * real -> bool,
5224   exn Div : exn,
5225   exn Overflow : exn,
5226   val abs : real -> real,
5227   val ceil : real -> int,
5228   val compare : real * real -> order,
5229   val floor : real -> int,
5230   val fmt : realfmt -> real -> string,
5231   val fromDefault : real -> real,
5232   val fromInt : int -> real,
5233   val fromString : string -> real option,
5234   val max : real * real -> real,
5235   val min : real * real -> real,
5236   val round : real -> int,
5237   val sameSign : real * real -> bool,
5238   val 'a scan : ('a -> (char * 'a) option) -> 'a -> (real * 'a) option,
5239   val sign : real -> int,
5240   val toDefault : real -> real,
5241   val toString : real -> string,
5242   val trunc : real -> int,
5243   val ~ : real -> real}
5244[opening file "sample2.sml"]
5245> val henryV =
5246    {born = 1387, crowned = 1413, died = 1422, name = "Henry V",
5247     quote = "Bid them achieve me and then sell my bones"} :
5248  {born : int, crowned : int, died : int, name : string, quote : string}
5249> val henryVI =
5250    {born = 1421, crowned = 1422, died = 1471, name = "Henry VI",
5251     quote = "Weep, wretched man, I'll aid thee tear for tear."} :
5252  {born : int, crowned : int, died : int, name : string, quote : string}
5253> val richardIII =
5254    {born = 1452, crowned = 1483, died = 1485, name = "Richard III",
5255     quote = "Plots have I laid, inductions dangerous..."} :
5256  {born : int, crowned : int, died : int, name : string, quote : string}
5257> type king =
5258  {born : int, crowned : int, died : int, name : string, quote : string}
5259> val power = fn : real * int -> real
5260> val naive_fib = fn : int -> int
5261> val nextfib = fn : int * int -> int * int
5262> val fibpair = fn : int -> int * int
5263> val itfib = fn : int * int * int -> int
5264> val fib = fn : int -> int
5265> val findroot = fn : real * real * real -> real
5266> val sqroot = fn : real -> real
5267> val sqroot = fn : real -> real
5268> val pos = fn : real -> real
5269  val neg = fn : real -> real
5270> val piapprox = fn : int -> real
5271> structure Complex :
5272  {type t = real * real,
5273   val diff : (real * real) * (real * real) -> real * real,
5274   val prod : (real * real) * (real * real) -> real * real,
5275   val quo : (real * real) * (real * real) -> real * real,
5276   val recip : real * real -> real * real,
5277   val sum : (real * real) * (real * real) -> real * real,
5278   val zero : real * real}
5279> signature ARITH =
5280  /\t.
5281    {type t = t,
5282     val zero : t,
5283     val sum : t * t -> t,
5284     val diff : t * t -> t,
5285     val prod : t * t -> t,
5286     val quo : t * t -> t}
5287[closing file "sample2.sml"]
5288> val it = () : unit
5289[opening file "sample3.sml"]
5290File "sample3.sml", line 27-30, characters 4-178:
5291! ....change (coinvals, 0)         = []
5292!   | change (c::coinvals, amount) =
5293!       if amount<c then change(coinvals, amount)
5294!                   else c :: change(c::coinvals, amount-c).
5295! Warning: pattern matching is not exhaustive
5296
5297> val change = fn : int list * int -> int list
5298> val gb_coins = [50, 20, 10, 5, 2, 1] : int list
5299  val us_coins = [25, 10, 5, 1] : int list
5300> val allChange = fn : int list * int list * int -> int list list
5301File "sample3.sml", line 46-48, characters 4-103:
5302! ....bincarry (0, ps) = ps
5303!   | bincarry (1, []) = [1]
5304!   | bincarry (1, p::ps) = (1-p) :: bincarry(p, ps).
5305! Warning: pattern matching is not exhaustive
5306
5307> val bincarry = fn : int * int list -> int list
5308> val binsum = fn : int * int list * int list -> int list
5309File "sample3.sml", line 57-59, characters 4-127:
5310! ....binprod ([], _) = []
5311!   | binprod (0::ps, qs) = 0::binprod(ps,qs)
5312!   | binprod (1::ps, qs) = binsum(0, qs, 0::binprod(ps,qs)).
5313! Warning: pattern matching is not exhaustive
5314
5315> val binprod = fn : int list * int list -> int list
5316File "sample3.sml", line 64-65, characters 4-71:
5317! ....headcol []    = []
5318!   | headcol ((x::_) :: rows) = x :: headcol rows.
5319! Warning: pattern matching is not exhaustive
5320
5321> val 'a headcol = fn : 'a list list -> 'a list
5322File "sample3.sml", line 67-68, characters 4-76:
5323! ....tailcols []    = []
5324!   | tailcols ((_::xs) :: rows) = xs :: tailcols rows.
5325! Warning: pattern matching is not exhaustive
5326
5327> val 'a tailcols = fn : 'a list list -> 'a list list
5328> val 'a transp = fn : 'a list list -> 'a list list
5329File "sample3.sml", line 77-78, characters 4-73:
5330! ....dotprod([], []) = 0.0
5331!   | dotprod(x::xs,y::ys) = x*y + dotprod(xs,ys).
5332! Warning: pattern matching is not exhaustive
5333
5334> val dotprod = fn : real list * real list -> real
5335> val rowprod = fn : real list * real list list -> real list
5336> val rowlistprod = fn : real list list * real list list -> real list list
5337> val matprod = fn : real list list * real list list -> real list list
5338File "sample3.sml", line 94-98, characters 4-172:
5339! ....pivotrow [row] = row : real list
5340!   | pivotrow (row1::row2::rows) =
5341!       if abs(hd row1) >= abs(hd row2)
5342!       then pivotrow(row1::rows)
5343!       else pivotrow(row2::rows).
5344! Warning: pattern matching is not exhaustive
5345
5346> val pivotrow = fn : real list list -> real list
5347> val delrow = fn : real * real list list -> real list list
5348> val scalarprod = fn : real * real list -> real list
5349File "sample3.sml", line 109-110, characters 4-93:
5350! ....vectorsum ([], []) = [] : real list
5351!   | vectorsum (x::xs,y::ys) = x+y :: vectorsum(xs,ys).
5352! Warning: pattern matching is not exhaustive
5353
5354> val vectorsum = fn : real list * real list -> real list
5355File "sample3.sml", line 115-118, characters 14-159:
5356! ..............elimcol [] = []
5357!             | elimcol ((x::xs)::rows) =
5358!                   vectorsum(xs, scalarprod(~x/p, prow))
5359!                   :: elimcol rows
5360! Warning: pattern matching is not exhaustive
5361
5362File "sample3.sml", line 114, characters 14-21:
5363!       let val p::prow = pivotrow rows
5364!               ^^^^^^^
5365! Warning: pattern matching is not exhaustive
5366
5367> val gausselim = fn : real list list -> real list list
5368File "sample3.sml", line 122-125, characters 4-139:
5369! ....solutions [] = [~1.0]
5370!   | solutions((x::xs)::rows) =
5371!       let val solns = solutions rows
5372!       in ~(dotprod(solns,xs)/x) :: solns  end.
5373! Warning: pattern matching is not exhaustive
5374
5375> val solutions = fn : real list list -> real list
5376> val squares = fn : int -> (int * int) list
5377File "sample3.sml", line 153-156, characters 14-174:
5378! ..............swap [x] = y::x::ys
5379!             | swap (x::xk::xs) =          (*x >= xk *)
5380!                 if xk>y then x::swap(xk::xs)
5381!                 else (y::xk::xs)@(x::ys)
5382! Warning: pattern matching is not exhaustive
5383
5384File "sample3.sml", line 150-158, characters 4-409:
5385! ....next(xlist, y::ys) : int list =
5386!     if hd xlist <= y then  next(y::xlist, ys)  (*still increasing*)
5387!     else  (*swap y with greatest xk such that x>=xk>y *)
5388!       let fun swap [x] = y::x::ys
5389!             | swap (x::xk::xs) =          (*x >= xk *)
5390!                 if xk>y then x::swap(xk::xs)
5391!                 else (y::xk::xs)@(x::ys)
5392!                          (* x > y >= xk >= xs *)
5393!       in swap(xlist) end.
5394! Warning: pattern matching is not exhaustive
5395
5396> val next = fn : int list * int list -> int list
5397File "sample3.sml", line 160, characters 4-36:
5398! fun nextperm (y::ys) = next([y], ys);
5399!     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5400! Warning: pattern matching is not exhaustive
5401
5402> val nextperm = fn : int list -> int list
5403> infix 0 mem
5404> val ''a mem = fn : ''a * ''a list -> bool
5405> val ''a newmem = fn : ''a * ''a list -> ''a list
5406> val ''a union = fn : ''a list * ''a list -> ''a list
5407> val ''a inter = fn : ''a list * ''a list -> ''a list
5408> val 'a powset = fn : 'a list * 'a list -> 'a list list
5409> val ('a, 'b) cartprod = fn : 'a list * 'b list -> ('a * 'b) list
5410> val (''a, 'b) nexts = fn : ''a * (''a * 'b) list -> 'b list
5411> val ''a depthf = fn : ''a list * (''a * ''a) list * ''a list -> ''a list
5412> val ''a depth = fn : ''a list * (''a * ''a) list * ''a list -> ''a list
5413> val ''a topsort = fn : (''a * ''a) list -> ''a list
5414> val ''a pathsort = fn : (''a * ''a) list -> ''a list
5415> val ('a, 'b) newvisit = fn : 'a * ('a list * 'b) -> 'a list * 'b
5416> val ''a cyclesort = fn : (''a * ''a) list -> ''a list * ''a list
5417> val nextrandom = fn : real -> real
5418  val truncto = fn : int -> real -> int
5419> val randlist = fn : int * real * real list -> real * real list
5420> val ins = fn : real * real list -> real list
5421> val insort = fn : real list -> real list
5422> val quick = fn : real list -> real list
5423> val merge = fn : real list * real list -> real list
5424> val tmergesort = fn : real list -> real list
5425> val tmergesort' = fn : real list -> real list
5426File "sample3.sml", line 317-320, characters 4-146:
5427! ....mergepairs([l], k) = [l]
5428!   | mergepairs(l1::l2::ls, k) =
5429!       if k mod 2 = 1 then l1::l2::ls
5430!       else mergepairs(merge(l1,l2)::ls, k div 2).
5431! Warning: pattern matching is not exhaustive
5432
5433> val mergepairs = fn : real list list * int -> real list list
5434> val sorting = fn : real list * real list list * int -> real list
5435> val sort = fn : real list -> real list
5436> val nextrun = fn : real list * real list -> real list * real list
5437> val samsorting = fn : real list * real list list * int -> real list
5438> val samsort = fn : real list -> real list
5439> nonfix rem
5440File "sample3.sml", line 381-387, characters 6-265:
5441! ......quorem (ts, (n,b)::us) =
5442!     let fun dividing ([],        qs) = (rev qs, [])
5443! 	  | dividing ((m,a)::ts, qs) =
5444! 	      if m<n then (rev qs, (m,a)::ts)
5445! 	      else dividing (sum (ts, termprod ((m-n, ~a/b), us)),
5446! 			(m-n, a/b) :: qs)
5447!     in  dividing (ts, [])  end.
5448! Warning: pattern matching is not exhaustive
5449
5450> structure Poly :
5451  {type t = (int * real) list,
5452   val gcd : (int * real) list * (int * real) list -> (int * real) list,
5453   val prod : (int * real) list * (int * real) list -> (int * real) list,
5454   val quo : (int * real) list * (int * real) list -> (int * real) list,
5455   val quorem :
5456     (int * real) list * (int * real) list ->
5457     (int * real) list * (int * real) list,
5458   val rem : (int * real) list * (int * real) list -> (int * real) list,
5459   val sum : (int * real) list * (int * real) list -> (int * real) list,
5460   val termprod : (int * real) * (int * real) list -> (int * real) list,
5461   val 'a zero : 'a list}
5462[closing file "sample3.sml"]
5463> val it = () : unit
5464[opening file "sample4.sml"]
5465> New type names: =person
5466  datatype person =
5467  (person,
5468   {con King : person,
5469    con Knight : string -> person,
5470    con Peasant : string -> person,
5471    con Peer : string * string * int -> person})
5472  con King = King : person
5473  con Knight = fn : string -> person
5474  con Peasant = fn : string -> person
5475  con Peer = fn : string * string * int -> person
5476> val title = fn : person -> string
5477> val sirs = fn : person list -> string list
5478> val superior = fn : person * person -> bool
5479> New type names: =degree
5480  datatype degree =
5481  (degree,
5482   {con Baron : degree,
5483    con Duke : degree,
5484    con Earl : degree,
5485    con Marquis : degree,
5486    con Viscount : degree})
5487  con Baron = Baron : degree
5488  con Duke = Duke : degree
5489  con Earl = Earl : degree
5490  con Marquis = Marquis : degree
5491  con Viscount = Viscount : degree
5492> val lady = fn : degree -> string
5493> exn Change = Change : exn
5494> val backChange = fn : int list * int -> int list
5495> New type names: =tree
5496  datatype 'a tree =
5497  ('a tree,
5498   {con 'a Br : 'a * 'a tree * 'a tree -> 'a tree, con 'a Lf : 'a tree})
5499  con 'a Br = fn : 'a * 'a tree * 'a tree -> 'a tree
5500  con 'a Lf = Lf : 'a tree
5501File "sample4.sml", line 106, characters 9-14:
5502! 	    val y::ys = List.drop(xs,k)
5503! 	        ^^^^^
5504! Warning: pattern matching is not exhaustive
5505
5506> structure Tree :
5507  {val 'a balin : 'a list -> 'a tree,
5508   val 'a balpost : 'a list -> 'a tree,
5509   val 'a balpre : 'a list -> 'a tree,
5510   val 'a depth : 'a tree -> int,
5511   val 'a inord : 'a tree * 'a list -> 'a list,
5512   val 'a postord : 'a tree * 'a list -> 'a list,
5513   val 'a preord : 'a tree * 'a list -> 'a list,
5514   val 'a reflect : 'a tree -> 'a tree,
5515   val 'a size : 'a tree -> int}
5516> signature DICTIONARY =
5517  /\key t.
5518    {type key = key,
5519     type 'a t = 'a t,
5520     exn E : key -> exn,
5521     val 'a empty : 'a t,
5522     val 'a lookup : 'a t * key -> 'a,
5523     val 'a insert : 'a t * key * 'a -> 'a t,
5524     val 'a update : 'a t * key * 'a -> 'a t}
5525> structure Dict :
5526  {type key = string,
5527   type 'a t = (string * 'a) tree,
5528   exn E : string -> exn,
5529   val 'a empty : (string * 'a) tree,
5530   val 'a insert : (string * 'a) tree * string * 'a -> (string * 'a) tree,
5531   val 'a lookup : (string * 'a) tree * string -> 'a,
5532   val 'a update : (string * 'a) tree * string * 'a -> (string * 'a) tree}
5533File "sample4.sml", line 195-197, characters 6-161:
5534! ......lorem Lf = raise Size
5535!     | lorem (Br(_,Lf,Lf)) = Lf 	(*No evens, therefore no odds either*)
5536!     | lorem (Br(_, t1 as Br(v,_,_), t2)) = Br(v, t2, lorem t1).
5537! Warning: pattern matching is not exhaustive
5538
5539> structure Braun :
5540  {val 'a delete : 'a tree * int -> 'a tree,
5541   val 'a loext : 'a tree * 'a -> 'a tree,
5542   val 'a lorem : 'a tree -> 'a tree,
5543   val 'a sub : 'a tree * int -> 'a,
5544   val 'a update : 'a tree * int * 'a -> 'a tree}
5545> signature FLEXARRAY =
5546  /\array.
5547    {type 'a array = 'a array,
5548     val 'a empty : 'a array,
5549     val 'a length : 'a array -> int,
5550     val 'a sub : 'a array * int -> 'a,
5551     val 'a update : 'a array * int * 'a -> 'a array,
5552     val 'a loext : 'a array * 'a -> 'a array,
5553     val 'a lorem : 'a array -> 'a array,
5554     val 'a hiext : 'a array * 'a -> 'a array,
5555     val 'a hirem : 'a array -> 'a array}
5556> New type names: =array
5557  structure Flex :
5558  {type 'a array = 'a array,
5559   val 'a empty : 'a array,
5560   val 'a hiext : 'a array * 'a -> 'a array,
5561   val 'a hirem : 'a array -> 'a array,
5562   val 'a length : 'a array -> int,
5563   val 'a loext : 'a array * 'a -> 'a array,
5564   val 'a lorem : 'a array -> 'a array,
5565   val 'a sub : 'a array * int -> 'a,
5566   val 'a update : 'a array * int * 'a -> 'a array}
5567> signature PRIORITY_QUEUE =
5568  /\item t.
5569    {type item = item,
5570     type t = t,
5571     val empty : t,
5572     val null : t -> bool,
5573     val insert : item * t -> t,
5574     val min : t -> item,
5575     val delmin : t -> t,
5576     val fromList : item list -> t,
5577     val toList : t -> item list,
5578     val sort : item list -> item list}
5579File "sample4.sml", line 276, characters 6-25:
5580!   fun min (Br(v,_,_)) = v;
5581!       ^^^^^^^^^^^^^^^^^^^
5582! Warning: pattern matching is not exhaustive
5583
5584File "sample4.sml", line 283-286, characters 6-130:
5585! ......leftrem (Br(v,Lf,Lf)) = (v, Lf)
5586!     | leftrem (Br(v,t1,t2)) =
5587!         let val (w, t) = leftrem t1
5588! 	in  (w, Br(v,t2,t))  end.
5589! Warning: pattern matching is not exhaustive
5590
5591File "sample4.sml", line 288-295, characters 6-403:
5592! ......siftdown (w:real, Lf, Lf) = Br(w,Lf,Lf)
5593!     | siftdown (w, t as Br(v,Lf,Lf), Lf) =
5594!         if w <= v then Br(w, t, Lf)
5595!                   else Br(v, Br(w,Lf,Lf), Lf)
5596!     | siftdown (w, t1 as Br(v1,p1,q1), t2 as Br(v2,p2,q2)) =
5597!         if w <= v1 andalso w <= v2 then Br(w,t1,t2)
5598!         else if v1 <= v2 then Br(v1, siftdown(w,p1,q1), t2)
5599!            (* v2 < v1 *) else Br(v2, t1, siftdown(w,p2,q2)).
5600! Warning: pattern matching is not exhaustive
5601
5602File "sample4.sml", line 303-307, characters 6-186:
5603! ......heapify (0, vs) = (Lf, vs)
5604!     | heapify (n, v::vs) =
5605! 	let val (t1, vs1) = heapify (n div 2, vs)
5606! 	    val (t2, vs2) = heapify ((n-1) div 2, vs1)
5607! 	in  (siftdown (v,t1,t2), vs2)  end.
5608! Warning: pattern matching is not exhaustive
5609
5610> structure Heap :
5611  {type item = real,
5612   type t = real tree,
5613   val delmin : real tree -> real tree,
5614   val empty : real tree,
5615   val fromList : real list -> real tree,
5616   val insert : real * real tree -> real tree,
5617   val min : real tree -> real,
5618   val null : real tree -> bool,
5619   val sort : real list -> real list,
5620   val toList : real tree -> real list}
5621> New type names: =prop
5622  datatype prop =
5623  (prop,
5624   {con Atom : string -> prop,
5625    con Conj : prop * prop -> prop,
5626    con Disj : prop * prop -> prop,
5627    con Neg : prop -> prop})
5628  con Atom = fn : string -> prop
5629  con Conj = fn : prop * prop -> prop
5630  con Disj = fn : prop * prop -> prop
5631  con Neg = fn : prop -> prop
5632> val show = fn : prop -> string
5633> val nnf = fn : prop -> prop
5634> val nnfpos = fn : prop -> prop
5635  val nnfneg = fn : prop -> prop
5636> val distrib = fn : prop * prop -> prop
5637> val cnf = fn : prop -> prop
5638> exn NonCNF = NonCNF : exn
5639> val positives = fn : prop -> string list
5640> val negatives = fn : prop -> string list
5641> val taut = fn : prop -> bool
5642[closing file "sample4.sml"]
5643> val it = () : unit
5644[opening file "sample5.sml"]
5645> val 'a insort = fn : ('a * 'a -> bool) -> 'a list -> 'a list
5646> val ('a, 'b, 'c) secl = fn : 'a -> ('a * 'b -> 'c) -> 'b -> 'c
5647> val ('a, 'b, 'c) secr = fn : ('a * 'b -> 'c) -> 'b -> 'a -> 'c
5648> val summation = fn : (int -> real) -> int -> real
5649> val 'a takewhile = fn : ('a -> bool) -> 'a list -> 'a list
5650> val 'a dropwhile = fn : ('a -> bool) -> 'a list -> 'a list
5651> infix 0 mem
5652> val ''a mem = fn : ''a * ''a list -> bool
5653> val ('a, 'b) pair = fn : 'a -> 'b -> 'a * 'b
5654> val ('a, 'b) cartprod = fn : 'a list * 'b list -> ('a * 'b) list
5655> val 'a repeat = fn : ('a -> 'a) -> int -> 'a -> 'a
5656> New type names: seq
5657  datatype 'a seq =
5658  ('a seq,{con 'a Cons : 'a * (unit -> 'a seq) -> 'a seq, con 'a Nil : 'a seq})
5659  con 'a Cons = fn : 'a * (unit -> 'a seq) -> 'a seq
5660  con 'a Nil = Nil : 'a seq
5661> signature SEQUENCE =
5662  {exn Empty : exn,
5663   val 'a cons : 'a * 'a seq -> 'a seq,
5664   val 'a null : 'a seq -> bool,
5665   val 'a hd : 'a seq -> 'a,
5666   val 'a tl : 'a seq -> 'a seq,
5667   val 'a fromList : 'a list -> 'a seq,
5668   val 'a toList : 'a seq -> 'a list,
5669   val 'a take : 'a seq * int -> 'a list,
5670   val 'a drop : 'a seq * int -> 'a seq,
5671   val 'a @ : 'a seq * 'a seq -> 'a seq,
5672   val 'a interleave : 'a seq * 'a seq -> 'a seq,
5673   val ('a, 'b) map : ('a -> 'b) -> 'a seq -> 'b seq,
5674   val 'a filter : ('a -> bool) -> 'a seq -> 'a seq,
5675   val 'a iterates : ('a -> 'a) -> 'a -> 'a seq,
5676   val from : int -> int seq}
5677> structure Seq :
5678  {val 'a @ : 'a seq * 'a seq -> 'a seq,
5679   exn Empty : exn,
5680   val 'a cons : 'a * 'a seq -> 'a seq,
5681   val 'a drop : 'a seq * int -> 'a seq,
5682   val 'a filter : ('a -> bool) -> 'a seq -> 'a seq,
5683   val from : int -> int seq,
5684   val 'a fromList : 'a list -> 'a seq,
5685   val 'a hd : 'a seq -> 'a,
5686   val 'a interleave : 'a seq * 'a seq -> 'a seq,
5687   val 'a iterates : ('a -> 'a) -> 'a -> 'a seq,
5688   val ('a, 'b) map : ('a -> 'b) -> 'a seq -> 'b seq,
5689   val 'a null : 'a seq -> bool,
5690   val 'a take : 'a seq * int -> 'a list,
5691   val 'a tl : 'a seq -> 'a seq,
5692   val 'a toList : 'a seq -> 'a list}
5693> val seqChange = fn :
5694  int list * int list * int * (unit -> int list seq) -> int list seq
5695> val randseq = fn : int -> real seq
5696> val sift = fn : int -> int seq -> int seq
5697File "sample5.sml", line 172, characters 4-62:
5698! fun sieve (Cons(p,nf)) = Cons(p, fn()=> sieve (sift p (nf())));
5699!     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5700! Warning: pattern matching is not exhaustive
5701
5702> val sieve = fn : int seq -> int seq
5703> val primes = Cons(2, fn) : int seq
5704> val nextApprox = fn : real -> real -> real
5705File "sample5.sml", line 182, characters 14-24:
5706!       let val Cons(y,yf) = xf()
5707!               ^^^^^^^^^^
5708! Warning: pattern matching is not exhaustive
5709
5710File "sample5.sml", line 181-185, characters 4-151:
5711! ....within (eps:real) (Cons(x,xf)) =
5712!       let val Cons(y,yf) = xf()
5713!       in  if Real.abs(x-y) < eps then y
5714! 	  else within eps (Cons(y,yf))
5715!       end.
5716! Warning: pattern matching is not exhaustive
5717
5718> val within = fn : real -> real seq -> real
5719> val qroot = fn : real -> real
5720> val ('a, 'b) makeqq = fn : 'a seq * 'b seq -> ('a * 'b) seq seq
5721> val 'a takeqq = fn : 'a seq seq * (int * int) -> 'a list list
5722> val 'a enumerate = fn : 'a seq seq -> 'a seq
5723> val double = fn : int -> int
5724> val powof2 = fn : int -> int
5725> val pack_ = fn : int * int -> int
5726> val pairqq = Cons(Cons((1, 1), fn), fn) : (int * int) seq seq
5727> val nqq = Cons(Cons(1, fn), fn) : int seq seq
5728> val 'a depthFirst = fn : ('a -> 'a list) -> 'a -> 'a seq
5729> val 'a breadthFirst = fn : ('a -> 'a list) -> 'a -> 'a seq
5730> val nextChar = fn : char list -> char list list
5731> val ''a isPalin = fn : ''a list -> bool
5732> val show = fn : int -> char list seq -> string list
5733> val it = ["", "A", "B", "C", "AA", "BB", "CC", "AAA"] : string list
5734> val safeQueen = fn : int list -> int -> bool
5735> val upto = fn : int * int -> int list
5736> val nextQueen = fn : int -> int list -> int list list
5737> val 'a isFull = fn : int -> 'a list -> bool
5738> val depthQueen = fn : int -> int list seq
5739> val 'a depthIter = fn : ('a -> 'a list) -> 'a -> 'a seq
5740[closing file "sample5.sml"]
5741> val it = () : unit
5742[opening file "sample7.sml"]
5743> structure Queue1 :
5744  {type 'a t = 'a list,
5745   exn E : exn,
5746   val 'a deq : 'a list -> 'a list,
5747   val 'a empty : 'a list,
5748   val 'a enq : 'a list * 'a -> 'a list,
5749   val 'a hd : 'a list -> 'a,
5750   val 'a null : 'a list -> bool}
5751> New type names: =t
5752  structure Queue2 :
5753  {datatype 'a t =
5754     ('a t,{con 'a empty : 'a t, con 'a enq : 'a t * 'a -> 'a t}),
5755   exn E : exn,
5756   val 'a deq : 'a t -> 'a t,
5757   con 'a empty : 'a t,
5758   con 'a enq : 'a t * 'a -> 'a t,
5759   val 'a hd : 'a t -> 'a,
5760   val 'a null : 'a t -> bool}
5761> New type names: =t/1
5762  structure Queue3 :
5763  {datatype 'a t = ('a t/1,{con 'a Queue : 'a list * 'a list -> 'a t/1}),
5764   exn E : exn,
5765   con 'a Queue : 'a list * 'a list -> 'a t/1,
5766   val 'a deq : 'a t/1 -> 'a t/1,
5767   val 'a empty : 'a t/1,
5768   val 'a enq : 'a t/1 * 'a -> 'a t/1,
5769   val 'a hd : 'a t/1 -> 'a,
5770   val 'a norm : 'a t/1 -> 'a t/1,
5771   val 'a null : 'a t/1 -> bool}
5772> signature QUEUE =
5773  /\t/2.
5774    {type 'a t = 'a t/2,
5775     exn E : exn,
5776     val 'a empty : 'a t/2,
5777     val 'a enq : 'a t/2 * 'a -> 'a t/2,
5778     val 'a null : 'a t/2 -> bool,
5779     val 'a hd : 'a t/2 -> 'a,
5780     val 'a deq : 'a t/2 -> 'a t/2}
5781> New type names: t/2
5782  structure Queue :
5783  {type 'a t = 'a t/2,
5784   exn E : exn,
5785   val 'a deq : 'a t/2 -> 'a t/2,
5786   val 'a empty : 'a t/2,
5787   val 'a enq : 'a t/2 * 'a -> 'a t/2,
5788   val 'a hd : 'a t/2 -> 'a,
5789   val 'a null : 'a t/2 -> bool}
5790File "sample7.sml", line 147, characters 6-23:
5791!   fun qhd(Q1(x::q)) = x;
5792!       ^^^^^^^^^^^^^^^^^
5793! Warning: pattern matching is not exhaustive
5794
5795File "sample7.sml", line 149, characters 6-26:
5796!   fun deq(Q1(x::q)) = Q1 q;
5797!       ^^^^^^^^^^^^^^^^^^^^
5798! Warning: pattern matching is not exhaustive
5799
5800> New type names: queue1
5801  type 'a queue1 = 'a queue1
5802  val 'a empty = <queue1> : 'a queue1
5803  val 'a enq = fn : 'a queue1 * 'a -> 'a queue1
5804  val 'a qnull = fn : 'a queue1 -> bool
5805  val 'a qhd = fn : 'a queue1 -> 'a
5806  val 'a deq = fn : 'a queue1 -> 'a queue1
5807File "sample7.sml", line 163-164, characters 6-57:
5808! ......qhd (Enq(Empty,x)) = x
5809!     | qhd (Enq(q,x)) = qhd q.
5810! Warning: pattern matching is not exhaustive
5811
5812File "sample7.sml", line 166-167, characters 6-69:
5813! ......deq (Enq(Empty,x)) = Empty
5814!     | deq (Enq(q,x)) = Enq(deq q, x).
5815! Warning: pattern matching is not exhaustive
5816
5817> New type names: queue2
5818  type 'a queue2 = 'a queue2
5819  val 'a empty = <queue2> : 'a queue2
5820  val 'a enq = fn : 'a queue2 * 'a -> 'a queue2
5821  val 'a qnull = fn : 'a queue2 -> bool
5822  val 'a qhd = fn : 'a queue2 -> 'a
5823  val 'a deq = fn : 'a queue2 -> 'a queue2
5824> functor TestQueue :
5825  !t/3.
5826   {type 'a t = 'a t/3,
5827    exn E : exn,
5828    val 'a empty : 'a t/3,
5829    val 'a enq : 'a t/3 * 'a -> 'a t/3,
5830    val 'a null : 'a t/3 -> bool,
5831    val 'a hd : 'a t/3 -> 'a,
5832    val 'a deq : 'a t/3 -> 'a t/3}->
5833       {val 'a fromList : 'a list -> 'a t/3, val 'a toList : 'a t/3 -> 'a list}
5834> functor BreadthFirst :
5835  !t/3.
5836   {type 'a t = 'a t/3,
5837    exn E : exn,
5838    val 'a empty : 'a t/3,
5839    val 'a enq : 'a t/3 * 'a -> 'a t/3,
5840    val 'a null : 'a t/3 -> bool,
5841    val 'a hd : 'a t/3 -> 'a,
5842    val 'a deq : 'a t/3 -> 'a t/3}->
5843       {val 'a enqlist : 'a t/3 -> 'a list -> 'a t/3,
5844        val 'a search : ('a -> 'a list) -> 'a -> 'a seq}
5845> structure Breadth :
5846  {val 'a enqlist : 'a t/2 -> 'a list -> 'a t/2,
5847   val 'a search : ('a -> 'a list) -> 'a -> 'a seq}
5848> val brQueen = fn : int -> int list seq
5849> structure Breadth1 :
5850  {val 'a enqlist : 'a list -> 'a list -> 'a list,
5851   val 'a search : ('a -> 'a list) -> 'a -> 'a seq}
5852> val brQueen1 = fn : int -> int list seq
5853> signature ZSP =
5854  /\t/3.
5855    {type t = t/3,
5856     val zero : t/3,
5857     val sum : t/3 * t/3 -> t/3,
5858     val prod : t/3 * t/3 -> t/3}
5859> functor MatrixZSP :
5860  !t/3.
5861   {type t = t/3,
5862    val zero : t/3,
5863    val sum : t/3 * t/3 -> t/3,
5864    val prod : t/3 * t/3 -> t/3}->
5865       {type t = t/3 list list,
5866        val prod : t/3 list list * t/3 list list -> t/3 list list,
5867        val sum : t/3 list list * t/3 list list -> t/3 list list,
5868        val zero : t/3 list list}
5869> structure IntZSP :
5870  {type t = int,
5871   val prod : int * int -> int,
5872   val sum : int * int -> int,
5873   val zero : int}
5874> structure BoolZSP :
5875  {type t = bool,
5876   val prod : bool * bool -> bool,
5877   val sum : bool * bool -> bool,
5878   val zero : bool}
5879File "sample7.sml", line 265, characters 6-15:
5880!   val SOME zero = Int.maxInt;
5881!       ^^^^^^^^^
5882! Warning: pattern matching is not exhaustive
5883
5884> structure PathZSP :
5885  {type t = int,
5886   val prod : int * int -> int,
5887   val sum : int * int -> int,
5888   val zero : int}
5889> structure PathMatrix :
5890  {type t = int list list,
5891   val prod : int list list * int list list -> int list list,
5892   val sum : int list list * int list list -> int list list,
5893   val zero : int list list}
5894> val fast_paths = fn : int list list -> int list list
5895> val zz = 1073741823 : int
5896> val mat =
5897    [[0, 3, 8, 1073741823, ~4], [1073741823, 0, 1073741823, 1, 7],
5898     [1073741823, 4, 0, 1073741823, 1073741823],
5899     [2, 1073741823, ~5, 0, 1073741823],
5900     [1073741823, 1073741823, 1073741823, 6, 0]] : int list list
5901> signature ORDER = /\t/3.{type t = t/3, val compare : t/3 * t/3 -> order}
5902> structure StringOrder :
5903  {type t = string, val compare : string * string -> order}
5904> functor Dictionary :
5905  !t/3.
5906   {type t = t/3, val compare : t/3 * t/3 -> order}->
5907       ?t/4.
5908        {type key = t/3,
5909         type 'a t = 'a t/4,
5910         exn E : t/3 -> exn,
5911         val 'a empty : 'a t/4,
5912         val 'a insert : 'a t/4 * t/3 * 'a -> 'a t/4,
5913         val 'a lookup : 'a t/4 * t/3 -> 'a,
5914         val 'a update : 'a t/4 * t/3 * 'a -> 'a t/4}
5915> New type names: t/3
5916  structure StringDict :
5917  {type key = string,
5918   type 'a t = 'a t/3,
5919   exn E : string -> exn,
5920   val 'a empty : 'a t/3,
5921   val 'a insert : 'a t/3 * string * 'a -> 'a t/3,
5922   val 'a lookup : 'a t/3 * string -> 'a,
5923   val 'a update : 'a t/3 * string * 'a -> 'a t/3}
5924> signature PRIORITY_QUEUE =
5925  /\t/4 t/5.
5926    {structure Item : {type t = t/4, val compare : t/4 * t/4 -> order},
5927     type t = t/5,
5928     val empty : t/5,
5929     val null : t/5 -> bool,
5930     val insert : t/4 * t/5 -> t/5,
5931     val min : t/5 -> t/4,
5932     val delmin : t/5 -> t/5,
5933     val fromList : t/4 list -> t/5,
5934     val toList : t/5 -> t/4 list,
5935     val sort : t/4 list -> t/4 list}
5936> functor AssocList :
5937  !=key.
5938   {type key = key}->
5939       {type key = key,
5940        type 'a t = (key * 'a) list,
5941        exn E : key -> exn,
5942        val 'a empty : (key * 'a) list,
5943        val 'a insert : (key * 'a) list * key * 'a -> (key * 'a) list,
5944        val 'a lookup : (key * 'a) list * key -> 'a,
5945        val 'a update : (key * 'a) list * key * 'a -> (key * 'a) list}
5946> signature TREE =
5947  /\=tree/1.
5948    {datatype 'a tree =
5949       ('a tree/1,
5950        {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
5951         con 'a Lf : 'a tree/1}),
5952     con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
5953     con 'a Lf : 'a tree/1,
5954     val 'a size : 'a tree/1 -> int,
5955     val 'a depth : 'a tree/1 -> int,
5956     val 'a reflect : 'a tree/1 -> 'a tree/1}
5957> signature BRAUN =
5958  /\=tree/1.
5959    {structure Tree :
5960       {datatype 'a tree =
5961          ('a tree/1,
5962           {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
5963            con 'a Lf : 'a tree/1}),
5964        con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
5965        con 'a Lf : 'a tree/1,
5966        val 'a size : 'a tree/1 -> int,
5967        val 'a depth : 'a tree/1 -> int,
5968        val 'a reflect : 'a tree/1 -> 'a tree/1},
5969     val 'a sub : 'a tree/1 * int -> 'a,
5970     val 'a update : 'a tree/1 * int * 'a -> 'a tree/1,
5971     val 'a delete : 'a tree/1 * int -> 'a tree/1,
5972     val 'a loext : 'a tree/1 * 'a -> 'a tree/1,
5973     val 'a lorem : 'a tree/1 -> 'a tree/1}
5974File "sample7.sml", line 425, characters 10-33:
5975!       fun min (PQ(Br(v,_,_))) = v;
5976!           ^^^^^^^^^^^^^^^^^^^^^^^
5977! Warning: pattern matching is not exhaustive
5978
5979File "sample7.sml", line 434-437, characters 10-131:
5980! ..........leftrem (Br(v,Lf,_)) = (v, Lf)
5981! 	| leftrem (Br(v,t1,t2)) =
5982! 	    let val (w, t) = leftrem t1
5983! 	    in  (w, Br(v,t2,t))  end.
5984! Warning: pattern matching is not exhaustive
5985
5986File "sample7.sml", line 454-458, characters 10-192:
5987! ..........heapify (0, vs) = (Lf, vs)
5988! 	| heapify (n, v::vs) =
5989! 	    let val (t1, vs1) = heapify (n div 2, vs)
5990! 		val (t2, vs2) = heapify ((n-1) div 2, vs1)
5991! 	    in  (siftdown (v,t1,t2), vs2)  end.
5992! Warning: pattern matching is not exhaustive
5993
5994> functor PriorityQueue :
5995  !t/4 =tree/1.
5996   {structure Item : {type t = t/4, val compare : t/4 * t/4 -> order},
5997    structure Tree :
5998      {datatype 'a tree =
5999         ('a tree/1,
6000          {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6001           con 'a Lf : 'a tree/1}),
6002       con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6003       con 'a Lf : 'a tree/1,
6004       val 'a size : 'a tree/1 -> int,
6005       val 'a depth : 'a tree/1 -> int,
6006       val 'a reflect : 'a tree/1 -> 'a tree/1}}->
6007       ?t/5.
6008        {structure Item : {type t = t/4, val compare : t/4 * t/4 -> order},
6009         type t = t/5,
6010         val delmin : t/5 -> t/5,
6011         val empty : t/5,
6012         val fromList : t/4 list -> t/5,
6013         val insert : t/4 * t/5 -> t/5,
6014         val min : t/5 -> t/4,
6015         val null : t/5 -> bool,
6016         val sort : t/4 list -> t/4 list,
6017         val toList : t/5 -> t/4 list}
6018> functor FlexArray :
6019  !=tree/1.
6020   {structure Tree :
6021      {datatype 'a tree =
6022         ('a tree/1,
6023          {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6024           con 'a Lf : 'a tree/1}),
6025       con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6026       con 'a Lf : 'a tree/1,
6027       val 'a size : 'a tree/1 -> int,
6028       val 'a depth : 'a tree/1 -> int,
6029       val 'a reflect : 'a tree/1 -> 'a tree/1},
6030    val 'a sub : 'a tree/1 * int -> 'a,
6031    val 'a update : 'a tree/1 * int * 'a -> 'a tree/1,
6032    val 'a delete : 'a tree/1 * int -> 'a tree/1,
6033    val 'a loext : 'a tree/1 * 'a -> 'a tree/1,
6034    val 'a lorem : 'a tree/1 -> 'a tree/1}->
6035       ?=array/1.
6036        {type 'a array = 'a array/1,
6037         val 'a empty : 'a array/1,
6038         val 'a hiext : 'a array/1 * 'a -> 'a array/1,
6039         val 'a hirem : 'a array/1 -> 'a array/1,
6040         val 'a length : 'a array/1 -> int,
6041         val 'a loext : 'a array/1 * 'a -> 'a array/1,
6042         val 'a lorem : 'a array/1 -> 'a array/1,
6043         val 'a sub : 'a array/1 * int -> 'a,
6044         val 'a update : 'a array/1 * int * 'a -> 'a array/1}
6045> functor BraunFunctor :
6046  !=tree/1.
6047   {datatype 'a tree =
6048      ('a tree/1,
6049       {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6050        con 'a Lf : 'a tree/1}),
6051    con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6052    con 'a Lf : 'a tree/1,
6053    val 'a size : 'a tree/1 -> int,
6054    val 'a depth : 'a tree/1 -> int,
6055    val 'a reflect : 'a tree/1 -> 'a tree/1}->
6056       {structure Tree :
6057          {datatype 'a tree =
6058             ('a tree/1,
6059              {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6060               con 'a Lf : 'a tree/1}),
6061           con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6062           con 'a Lf : 'a tree/1,
6063           val 'a depth : 'a tree/1 -> int,
6064           val 'a reflect : 'a tree/1 -> 'a tree/1,
6065           val 'a size : 'a tree/1 -> int},
6066        val 'a delete : 'a tree/1 * int -> 'a tree/1,
6067        val 'a loext : 'a tree/1 * 'a -> 'a tree/1,
6068        val 'a lorem : 'a tree/1 -> 'a tree/1,
6069        val 'a sub : 'a tree/1 * int -> 'a,
6070        val 'a update : 'a tree/1 * int * 'a -> 'a tree/1}
6071File "sample7.sml", line 577, characters 9-14:
6072! 	    val y::ys = List.drop(xs,k)
6073! 	        ^^^^^
6074! Warning: pattern matching is not exhaustive
6075
6076> functor TreeFunctor :
6077  {}->
6078      ?=tree/1.
6079       {datatype 'a tree =
6080          ('a tree/1,
6081           {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6082            con 'a Lf : 'a tree/1}),
6083        con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6084        con 'a Lf : 'a tree/1,
6085        val 'a depth : 'a tree/1 -> int,
6086        val 'a reflect : 'a tree/1 -> 'a tree/1,
6087        val 'a size : 'a tree/1 -> int}
6088> New type names: =tree/1
6089  structure Tree :
6090  {datatype 'a tree =
6091     ('a tree/1,
6092      {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6093       con 'a Lf : 'a tree/1}),
6094   con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6095   con 'a Lf : 'a tree/1,
6096   val 'a depth : 'a tree/1 -> int,
6097   val 'a reflect : 'a tree/1 -> 'a tree/1,
6098   val 'a size : 'a tree/1 -> int}
6099> structure Braun :
6100  {structure Tree :
6101     {datatype 'a tree =
6102        ('a tree/1,
6103         {con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6104          con 'a Lf : 'a tree/1}),
6105      con 'a Br : 'a * 'a tree/1 * 'a tree/1 -> 'a tree/1,
6106      con 'a Lf : 'a tree/1,
6107      val 'a depth : 'a tree/1 -> int,
6108      val 'a reflect : 'a tree/1 -> 'a tree/1,
6109      val 'a size : 'a tree/1 -> int},
6110   val 'a delete : 'a tree/1 * int -> 'a tree/1,
6111   val 'a loext : 'a tree/1 * 'a -> 'a tree/1,
6112   val 'a lorem : 'a tree/1 -> 'a tree/1,
6113   val 'a sub : 'a tree/1 * int -> 'a,
6114   val 'a update : 'a tree/1 * int * 'a -> 'a tree/1}
6115> New type names: =array/1
6116  structure Flex :
6117  {type 'a array = 'a array/1,
6118   val 'a empty : 'a array/1,
6119   val 'a hiext : 'a array/1 * 'a -> 'a array/1,
6120   val 'a hirem : 'a array/1 -> 'a array/1,
6121   val 'a length : 'a array/1 -> int,
6122   val 'a loext : 'a array/1 * 'a -> 'a array/1,
6123   val 'a lorem : 'a array/1 -> 'a array/1,
6124   val 'a sub : 'a array/1 * int -> 'a,
6125   val 'a update : 'a array/1 * int * 'a -> 'a array/1}
6126> New type names: t/4
6127  structure StringPQueue :
6128  {structure Item : {type t = string, val compare : string * string -> order},
6129   type t = t/4,
6130   val delmin : t/4 -> t/4,
6131   val empty : t/4,
6132   val fromList : string list -> t/4,
6133   val insert : string * t/4 -> t/4,
6134   val min : t/4 -> string,
6135   val null : t/4 -> bool,
6136   val sort : string list -> string list,
6137   val toList : t/4 -> string list}
6138[closing file "sample7.sml"]
6139> val it = () : unit
6140[opening file "sample8.sml"]
6141> val impFact = fn : int -> int
6142> val pFact = fn : int * int ref -> unit
6143> val 'a irev = fn : 'a list -> 'a list
6144> signature IMP_SEQUENCE =
6145  /\t/5.
6146    {type 'a t = 'a t/5,
6147     exn Empty : exn,
6148     val 'a empty : 'a t/5,
6149     val 'a cons : 'a * (unit -> 'a t/5) -> 'a t/5,
6150     val 'a null : 'a t/5 -> bool,
6151     val 'a hd : 'a t/5 -> 'a,
6152     val 'a tl : 'a t/5 -> 'a t/5,
6153     val 'a take : 'a t/5 * int -> 'a list,
6154     val 'a toList : 'a t/5 -> 'a list,
6155     val 'a fromList : 'a list -> 'a t/5,
6156     val 'a @ : 'a t/5 * 'a t/5 -> 'a t/5,
6157     val 'a interleave : 'a t/5 * 'a t/5 -> 'a t/5,
6158     val 'a concat : 'a t/5 t/5 -> 'a t/5,
6159     val ('a, 'b) map : ('a -> 'b) -> 'a t/5 -> 'b t/5,
6160     val 'a filter : ('a -> bool) -> 'a t/5 -> 'a t/5,
6161     val 'a cycle : ((unit -> 'a t/5) -> 'a t/5) -> 'a t/5}
6162File "sample8.sml", line 102-103, characters 6-49:
6163! ......null Nil = true
6164!     | null (Cons _) = false.
6165! Warning: pattern matching is not exhaustive
6166
6167File "sample8.sml", line 105-106, characters 6-51:
6168! ......hd Nil = raise Empty
6169!     | hd (Cons(x,_)) = x.
6170! Warning: pattern matching is not exhaustive
6171
6172File "sample8.sml", line 108-109, characters 6-59:
6173! ......tl Nil = raise Empty
6174!     | tl (Cons(_,xp)) = force xp.
6175! Warning: pattern matching is not exhaustive
6176
6177File "sample8.sml", line 111-113, characters 6-103:
6178! ......take (xq, 0) = []
6179!     | take (Nil, n) = []
6180!     | take (Cons(x,xp), n) = x :: take (force xp, n-1).
6181! Warning: pattern matching is not exhaustive
6182
6183File "sample8.sml", line 115-116, characters 6-72:
6184! ......toList Nil = []
6185!     | toList (Cons(x,xp)) = x :: toList (force xp).
6186! Warning: pattern matching is not exhaustive
6187
6188File "sample8.sml", line 121-123, characters 6-87:
6189! ......Nil @ yq = yq
6190!     | (Cons(x,xp)) @ yq =
6191! 	  Cons(x, delay(fn()=> (force xp) @ yq)).
6192! Warning: pattern matching is not exhaustive
6193
6194File "sample8.sml", line 125-127, characters 6-123:
6195! ......interleave (Nil,    yq) = yq
6196!     | interleave (Cons(x,xp), yq) =
6197! 	  Cons(x, delay (fn()=> interleave(yq, force xp))).
6198! Warning: pattern matching is not exhaustive
6199
6200File "sample8.sml", line 137-139, characters 6-102:
6201! ......map f Nil  = Nil
6202!     | map f (Cons(x,xp)) =
6203!           Cons(f x, delay(fn()=> map f (force xp))).
6204! Warning: pattern matching is not exhaustive
6205
6206File "sample8.sml", line 141-145, characters 6-166:
6207! ......filter pred Nil = Nil
6208!     | filter pred (Cons(x,xp)) =
6209! 	  if pred x
6210!           then Cons(x, delay(fn()=> filter pred (force xp)))
6211! 	  else filter pred (force xp).
6212! Warning: pattern matching is not exhaustive
6213
6214> New type names: t/5
6215  structure ImpSeq :
6216  {type 'a t = 'a t/5,
6217   val 'a @ : 'a t/5 * 'a t/5 -> 'a t/5,
6218   exn Empty : exn,
6219   val 'a concat : 'a t/5 t/5 -> 'a t/5,
6220   val 'a cons : 'a * (unit -> 'a t/5) -> 'a t/5,
6221   val 'a cycle : ((unit -> 'a t/5) -> 'a t/5) -> 'a t/5,
6222   val 'a empty : 'a t/5,
6223   val 'a filter : ('a -> bool) -> 'a t/5 -> 'a t/5,
6224   val 'a fromList : 'a list -> 'a t/5,
6225   val 'a hd : 'a t/5 -> 'a,
6226   val 'a interleave : 'a t/5 * 'a t/5 -> 'a t/5,
6227   val ('a, 'b) map : ('a -> 'b) -> 'a t/5 -> 'b t/5,
6228   val 'a null : 'a t/5 -> bool,
6229   val 'a take : 'a t/5 * int -> 'a list,
6230   val 'a tl : 'a t/5 -> 'a t/5,
6231   val 'a toList : 'a t/5 -> 'a list}
6232> val ('a, 'b) pairs = fn : 'a t/5 * 'b t/5 -> ('a * 'b) t/5
6233> val add = fn : int t/5 * int t/5 -> int t/5
6234> val fib = <t> : int t/5
6235> val it =
6236    [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584,
6237     4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811,
6238     514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352,
6239     24157817, 39088169, 63245986, 102334155] : int list
6240> signature RINGBUF =
6241  /\=t/6.
6242    {type 'a t = 'a t/6,
6243     exn Empty : exn,
6244     val 'a empty : unit -> 'a t/6,
6245     val 'a null : 'a t/6 -> bool,
6246     val 'a label : 'a t/6 -> 'a,
6247     val 'a moveLeft : 'a t/6 -> unit,
6248     val 'a moveRight : 'a t/6 -> unit,
6249     val 'a insert : 'a t/6 * 'a -> unit,
6250     val 'a delete : 'a t/6 -> 'a}
6251> New type names: =t/6
6252  structure RingBuf :
6253  {type 'a t = 'a t/6,
6254   exn Empty : exn,
6255   val 'a delete : 'a t/6 -> 'a,
6256   val 'a empty : unit -> 'a t/6,
6257   val 'a insert : 'a t/6 * 'a -> unit,
6258   val 'a label : 'a t/6 -> 'a,
6259   val 'a moveLeft : 'a t/6 -> unit,
6260   val 'a moveRight : 'a t/6 -> unit,
6261   val 'a null : 'a t/6 -> bool}
6262> signature VARRAY =
6263  /\t/7.
6264    {type 'a t = 'a t/7,
6265     val 'a array : int * 'a -> 'a t/7,
6266     val 'a reroot : 'a t/7 -> 'a t/7,
6267     val 'a sub : 'a t/7 * int -> 'a,
6268     val 'a justUpdate : 'a t/7 * int * 'a -> 'a t/7,
6269     val 'a update : 'a t/7 * int * 'a -> 'a t/7}
6270File "sample8.sml", line 280, characters 12-20:
6271! 	       val Main ary = !bnext
6272! 	           ^^^^^^^^
6273! Warning: pattern matching is not exhaustive
6274
6275File "sample8.sml", line 278, characters 12-57:
6276! 	   let val Modif{index=bindex,elem=belem,next=bnext,...} =
6277! 	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6278! Warning: pattern matching is not exhaustive
6279
6280File "sample8.sml", line 274-287, characters 6-417:
6281! ......reroot (va as Modif{index, elem, next,...}) =
6282!       case !next of
6283! 	 Main _ => va  (*have reached root*)
6284!        | Modif _ =>
6285! ..........
6286! 	       next := !bnext;
6287! 	       bnext := va;
6288! 	       va
6289! 	   end.
6290! Warning: pattern matching is not exhaustive
6291
6292File "sample8.sml", line 290-294, characters 6-168:
6293! ......sub (Modif{index,elem,next,...}, i) =
6294!        case !next of
6295! 	  Main ary => Array.sub(ary,i)
6296! 	| Modif _ =>    if !index = i then !elem
6297! 				      else sub(!next,i).
6298! Warning: pattern matching is not exhaustive
6299
6300File "sample8.sml", line 297-301, characters 6-169:
6301! ......justUpdate(va as Modif{limit,...}, i, x) =
6302! 	if  0<=i andalso i<limit
6303! 	then Modif{limit=limit, index= ref i,
6304! 		   elem=ref x, next=ref va}
6305! 	else raise Subscript.
6306! Warning: pattern matching is not exhaustive
6307
6308> New type names: t/7
6309  structure Varray :
6310  {type 'a t = 'a t/7,
6311   val 'a array : int * 'a -> 'a t/7,
6312   val 'a justUpdate : 'a t/7 * int * 'a -> 'a t/7,
6313   val 'a reroot : 'a t/7 -> 'a t/7,
6314   val 'a sub : 'a t/7 * int -> 'a,
6315   val 'a update : 'a t/7 * int * 'a -> 'a t/7}
6316> val months =
6317    ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT",
6318     "NOV", "DEC"] : string list
6319File "sample8.sml", line 322, characters 10-19:
6320!       val SOME year = Int.fromString syear
6321!           ^^^^^^^^^
6322! Warning: pattern matching is not exhaustive
6323
6324File "sample8.sml", line 320, characters 10-18:
6325!       val SOME day = Int.fromString sday
6326!           ^^^^^^^^
6327! Warning: pattern matching is not exhaustive
6328
6329File "sample8.sml", line 319, characters 10-30:
6330!   let val sday::smon::syear::_ = String.tokens (fn c => c = #"-") s
6331!           ^^^^^^^^^^^^^^^^^^^^
6332! Warning: pattern matching is not exhaustive
6333
6334> val dateFromString = fn : string -> (int * string * int) option
6335> val firstChar = fn : string -> char
6336> val initials = fn : string -> string
6337> val it = "Mritfawt" : string
6338> val batchInitials = fn : instream * outstream -> unit
6339> val promptInitials = fn : instream * outstream -> unit
6340> val firstLine = fn : string -> string
6341> val htmlCvt = fn : string -> unit
6342> signature PRETTY =
6343  /\t/8.
6344    {type t = t/8,
6345     val blo : int * t/8 list -> t/8,
6346     val str : string -> t/8,
6347     val brk : int -> t/8,
6348     val pr : outstream * t/8 * int -> unit}
6349> New type names: =t/8
6350  structure Pretty :
6351  {type t = t/8,
6352   val blo : int * t/8 list -> t/8,
6353   val brk : int -> t/8,
6354   val pr : outstream * t/8 * int -> unit,
6355   val str : string -> t/8}
6356> val prettyshow = fn : prop -> t/8
6357[closing file "sample8.sml"]
6358> val it = () : unit
6359[opening file "sample9.sml"]
6360> signature KEYWORD = {val alphas : string list, val symbols : string list}
6361> signature LEXICAL =
6362  /\=token.
6363    {datatype token =
6364       (token,{con Id : string -> token, con Key : string -> token}),
6365     con Id : string -> token,
6366     con Key : string -> token,
6367     val scan : string -> token list}
6368> functor Lexical :
6369  {val alphas : string list, val symbols : string list}->
6370      ?=token.
6371       {datatype token =
6372          (token,{con Id : string -> token, con Key : string -> token}),
6373        con Id : string -> token,
6374        con Key : string -> token,
6375        val scan : string -> token list}
6376> infix 6 $--
6377> infix 5 --
6378> infix 3 >>
6379> infix 0 ||
6380> signature PARSE =
6381  /\token.
6382    {exn SyntaxErr : string -> exn,
6383     type token = token,
6384     val id : token list -> string * token list,
6385     val $ : string -> token list -> string * token list,
6386     val ('b, 'a) empty : 'a -> 'b list * 'a,
6387     val ('a, 'b) || : ('a -> 'b) * ('a -> 'b) -> 'a -> 'b,
6388     val ('a, 'b, 'c) !! : ('a -> 'b * 'c) -> 'a -> 'b * 'c,
6389     val ('c, 'a, 'b, 'd, 'e) -- :
6390       ('a -> 'b * 'c) * ('c -> 'd * 'e) -> 'a -> ('b * 'd) * 'e,
6391     val ('a, 'b) $-- :
6392       string * (token list -> 'a * 'b) -> token list -> 'a * 'b,
6393     val ('b, 'a, 'd, 'c) >> : ('a -> 'b * 'c) * ('b -> 'd) -> 'a -> 'd * 'c,
6394     val ('b, 'a) repeat : ('a -> 'b * 'a) -> 'a -> 'b list * 'a,
6395     val 'a infixes :
6396       (token list -> 'a * token list) * (string -> int) *
6397       (string -> 'a -> 'a -> 'a) -> token list -> 'a * token list,
6398     val ('b, 'a) reader : (token list -> 'a * 'b list) -> string -> 'a}
6399> functor Parsing :
6400  !=token.
6401   {datatype token =
6402      (token,{con Id : string -> token, con Key : string -> token}),
6403    con Id : string -> token,
6404    con Key : string -> token,
6405    val scan : string -> token list}->
6406       {type token = token,
6407        val ('a, 'b, 'c) !! : ('a -> 'b * 'c) -> 'a -> 'b * 'c,
6408        val $ : string -> token list -> string * token list,
6409        val ('a, 'b) $-- :
6410          string * (token list -> 'a * 'b) -> token list -> 'a * 'b,
6411        val ('c, 'a, 'b, 'd, 'e) -- :
6412          ('a -> 'b * 'c) * ('c -> 'd * 'e) -> 'a -> ('b * 'd) * 'e,
6413        val ('b, 'a, 'd, 'c) >> :
6414          ('a -> 'b * 'c) * ('b -> 'd) -> 'a -> 'd * 'c,
6415        exn SyntaxErr : string -> exn,
6416        val ('b, 'a) empty : 'a -> 'b list * 'a,
6417        val id : token list -> string * token list,
6418        val 'a infixes :
6419          (token list -> 'a * token list) * (string -> int) *
6420          (string -> 'a -> 'a -> 'a) -> token list -> 'a * token list,
6421        val ('b, 'a) reader : (token list -> 'a * 'b list) -> string -> 'a,
6422        val ('b, 'a) repeat : ('a -> 'b * 'a) -> 'a -> 'b list * 'a,
6423        val ('a, 'b) || : ('a -> 'b) * ('a -> 'b) -> 'a -> 'b}
6424> signature TYPE =
6425  /\=t/9.
6426    {datatype t =
6427       (t/9,{con Con : string * t/9 list -> t/9, con Var : string -> t/9}),
6428     con Con : string * t/9 list -> t/9,
6429     con Var : string -> t/9,
6430     val pr : t/9 -> unit,
6431     val read : string -> t/9}
6432> structure LamKey : {val 'a alphas : 'a list, val symbols : string list}
6433> New type names: =token
6434  structure LamLex :
6435  {datatype token =
6436     (token,{con Id : string -> token, con Key : string -> token}),
6437   con Id : string -> token,
6438   con Key : string -> token,
6439   val scan : string -> token list}
6440> structure LamParsing :
6441  {type token = token,
6442   val ('a, 'b, 'c) !! : ('a -> 'b * 'c) -> 'a -> 'b * 'c,
6443   val $ : string -> token list -> string * token list,
6444   val ('a, 'b) $-- :
6445     string * (token list -> 'a * 'b) -> token list -> 'a * 'b,
6446   val ('c, 'a, 'b, 'd, 'e) -- :
6447     ('a -> 'b * 'c) * ('c -> 'd * 'e) -> 'a -> ('b * 'd) * 'e,
6448   val ('b, 'a, 'd, 'c) >> : ('a -> 'b * 'c) * ('b -> 'd) -> 'a -> 'd * 'c,
6449   exn SyntaxErr : string -> exn,
6450   val ('b, 'a) empty : 'a -> 'b list * 'a,
6451   val id : token list -> string * token list,
6452   val 'a infixes :
6453     (token list -> 'a * token list) * (string -> int) *
6454     (string -> 'a -> 'a -> 'a) -> token list -> 'a * token list,
6455   val ('b, 'a) reader : (token list -> 'a * 'b list) -> string -> 'a,
6456   val ('b, 'a) repeat : ('a -> 'b * 'a) -> 'a -> 'b list * 'a,
6457   val ('a, 'b) || : ('a -> 'b) * ('a -> 'b) -> 'a -> 'b}
6458File "sample9.sml", line 212-216, characters 8-161:
6459! ........typ (Var a) = Pretty.str a
6460!       | typ (Con("->",[ty1,ty2])) = Pretty.blo(0, [atom ty1,
6461! 						 Pretty.str " ->",
6462! 						 Pretty.brk 1,
6463! 						 typ ty2])
6464! Warning: pattern matching is not exhaustive
6465
6466> New type names: =t/9
6467  structure Type :
6468  {datatype t =
6469     (t/9,{con Con : string * t/9 list -> t/9, con Var : string -> t/9}),
6470   con Con : string * t/9 list -> t/9,
6471   con Var : string -> t/9,
6472   val pr : t/9 -> unit,
6473   val read : string -> t/9}
6474> signature LAMBDA =
6475  /\=t/10.
6476    {datatype t =
6477       (t/10,
6478        {con Abs : string * t/10 -> t/10,
6479         con Apply : t/10 * t/10 -> t/10,
6480         con Bound : int -> t/10,
6481         con Free : string -> t/10}),
6482     con Abs : string * t/10 -> t/10,
6483     con Apply : t/10 * t/10 -> t/10,
6484     con Bound : int -> t/10,
6485     con Free : string -> t/10,
6486     val abstract : int -> string -> t/10 -> t/10,
6487     val absList : string list * t/10 -> t/10,
6488     val applyList : t/10 * t/10 list -> t/10,
6489     val subst : int -> t/10 -> t/10 -> t/10,
6490     val inst : t/10 t/3 -> t/10 -> t/10}
6491> New type names: =t/10
6492  structure Lambda :
6493  {datatype t =
6494     (t/10,
6495      {con Abs : string * t/10 -> t/10,
6496       con Apply : t/10 * t/10 -> t/10,
6497       con Bound : int -> t/10,
6498       con Free : string -> t/10}),
6499   con Abs : string * t/10 -> t/10,
6500   con Apply : t/10 * t/10 -> t/10,
6501   con Bound : int -> t/10,
6502   con Free : string -> t/10,
6503   val absList : string list * t/10 -> t/10,
6504   val abstract : int -> string -> t/10 -> t/10,
6505   val applyList : t/10 * t/10 list -> t/10,
6506   val inst : t/10 t/3 -> t/10 -> t/10,
6507   val subst : int -> t/10 -> t/10 -> t/10}
6508> signature PARSE_TERM = {val read : string -> t/10}
6509> structure ParseTerm : {val read : string -> t/10}
6510> signature DISPLAY_TERM =
6511  {val rename : string list * string -> string,
6512   val stripAbs : t/10 -> string list * t/10,
6513   val pr : t/10 -> unit}
6514File "sample9.sml", line 352, characters 11-20:
6515! 	  let val (b::bs,u) = stripAbs t
6516! 	          ^^^^^^^^^
6517! Warning: pattern matching is not exhaustive
6518
6519> structure DisplayTerm :
6520  {val pr : t/10 -> unit,
6521   val rename : string list * string -> string,
6522   val stripAbs : t/10 -> string list * t/10}
6523> signature REDUCE =
6524  {val eval : t/10 -> t/10,
6525   val byValue : t/10 -> t/10,
6526   val headNF : t/10 -> t/10,
6527   val byName : t/10 -> t/10}
6528> structure Reduce :
6529  {val byName : t/10 -> t/10,
6530   val byValue : t/10 -> t/10,
6531   val eval : t/10 -> t/10,
6532   val headNF : t/10 -> t/10}
6533> val insertEnv = fn : (string * string) * t/10 t/3 -> t/10 t/3
6534> val stdEnv = <t> : t/10 t/3
6535> val stdRead = fn : string -> t/10
6536> val try = fn : (t/10 -> t/10) -> string -> unit
6537[closing file "sample9.sml"]
6538> val it = () : unit
6539[opening file "sample10.sml"]
6540> signature FOL =
6541  /\=term =form.
6542    {datatype term =
6543       (term,
6544        {con Bound : int -> term,
6545         con Fun : string * term list -> term,
6546         con Param : string * string list -> term,
6547         con Var : string -> term}),
6548     con Bound : int -> term,
6549     con Fun : string * term list -> term,
6550     con Param : string * string list -> term,
6551     con Var : string -> term,
6552     datatype form =
6553       (form,
6554        {con Conn : string * form list -> form,
6555         con Pred : string * term list -> form,
6556         con Quant : string * string * form -> form}),
6557     con Conn : string * form list -> form,
6558     con Pred : string * term list -> form,
6559     con Quant : string * string * form -> form,
6560     type goal = form list * form list,
6561     val precOf : string -> int,
6562     val abstract : int -> term -> form -> form,
6563     val subst : int -> term -> form -> form,
6564     val termVars : term * string list -> string list,
6565     val goalVars : (form list * form list) * string list -> string list,
6566     val termParams :
6567       term * (string * string list) list -> (string * string list) list,
6568     val goalParams :
6569       (form list * form list) * (string * string list) list ->
6570       (string * string list) list}
6571> New type names: =term, =form
6572  structure Fol :
6573  {datatype term =
6574     (term,
6575      {con Bound : int -> term,
6576       con Fun : string * term list -> term,
6577       con Param : string * string list -> term,
6578       con Var : string -> term}),
6579   datatype form =
6580     (form,
6581      {con Conn : string * form list -> form,
6582       con Pred : string * term list -> form,
6583       con Quant : string * string * form -> form}),
6584   type goal = form list * form list,
6585   con Bound : int -> term,
6586   con Conn : string * form list -> form,
6587   con Fun : string * term list -> term,
6588   con Param : string * string list -> term,
6589   con Pred : string * term list -> form,
6590   con Quant : string * string * form -> form,
6591   con Var : string -> term,
6592   val abstract : int -> term -> form -> form,
6593   val goalParams :
6594     (form list * form list) * (string * string list) list ->
6595     (string * string list) list,
6596   val goalVars : (form list * form list) * string list -> string list,
6597   val precOf : string -> int,
6598   val subst : int -> term -> form -> form,
6599   val termParams :
6600     term * (string * string list) list -> (string * string list) list,
6601   val termVars : term * string list -> string list}
6602> structure FolKey : {val alphas : string list, val symbols : string list}
6603> New type names: =token/1
6604  structure FolLex :
6605  {datatype token =
6606     (token/1,{con Id : string -> token/1, con Key : string -> token/1}),
6607   con Id : string -> token/1,
6608   con Key : string -> token/1,
6609   val scan : string -> token/1 list}
6610> structure FolParsing :
6611  {type token = token/1,
6612   val ('a, 'b, 'c) !! : ('a -> 'b * 'c) -> 'a -> 'b * 'c,
6613   val $ : string -> token/1 list -> string * token/1 list,
6614   val ('a, 'b) $-- :
6615     string * (token/1 list -> 'a * 'b) -> token/1 list -> 'a * 'b,
6616   val ('c, 'a, 'b, 'd, 'e) -- :
6617     ('a -> 'b * 'c) * ('c -> 'd * 'e) -> 'a -> ('b * 'd) * 'e,
6618   val ('b, 'a, 'd, 'c) >> : ('a -> 'b * 'c) * ('b -> 'd) -> 'a -> 'd * 'c,
6619   exn SyntaxErr : string -> exn,
6620   val ('b, 'a) empty : 'a -> 'b list * 'a,
6621   val id : token/1 list -> string * token/1 list,
6622   val 'a infixes :
6623     (token/1 list -> 'a * token/1 list) * (string -> int) *
6624     (string -> 'a -> 'a -> 'a) -> token/1 list -> 'a * token/1 list,
6625   val ('b, 'a) reader : (token/1 list -> 'a * 'b list) -> string -> 'a,
6626   val ('b, 'a) repeat : ('a -> 'b * 'a) -> 'a -> 'b list * 'a,
6627   val ('a, 'b) || : ('a -> 'b) * ('a -> 'b) -> 'a -> 'b}
6628> signature PARSE_FOL = {val read : string -> form}
6629> structure ParseFol : {val read : string -> form}
6630> signature DISPLAY_FOL =
6631  {val form : form -> unit, val goal : int -> form list * form list -> unit}
6632File "sample10.sml", line 192, characters 6-62:
6633!   fun list (sexp::sexps) = Pretty.blo(0, sexp :: commas sexps);
6634!       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6635! Warning: pattern matching is not exhaustive
6636
6637> structure DisplayFol :
6638  {val form : form -> unit, val goal : int -> form list * form list -> unit}
6639> signature UNIFY =
6640  {exn Failed : exn,
6641   val atoms : form * form -> term t/3,
6642   val instTerm : term t/3 -> term -> term,
6643   val instForm : term t/3 -> form -> form,
6644   val instGoal : term t/3 -> form list * form list -> form list * form list}
6645> structure Unify :
6646  {exn Failed : exn,
6647   val atoms : form * form -> term t/3,
6648   val instForm : term t/3 -> form -> form,
6649   val instGoal : term t/3 -> form list * form list -> form list * form list,
6650   val instTerm : term t/3 -> term -> term}
6651> signature RULE =
6652  /\state.
6653    {type state = state,
6654     type tactic = state -> state t/5,
6655     val main : state -> form,
6656     val subgoals : state -> (form list * form list) list,
6657     val initial : form -> state,
6658     val final : state -> bool,
6659     val basic : int -> state -> state t/5,
6660     val unify : int -> state -> state t/5,
6661     val conjL : int -> state -> state t/5,
6662     val conjR : int -> state -> state t/5,
6663     val disjL : int -> state -> state t/5,
6664     val disjR : int -> state -> state t/5,
6665     val impL : int -> state -> state t/5,
6666     val impR : int -> state -> state t/5,
6667     val negL : int -> state -> state t/5,
6668     val negR : int -> state -> state t/5,
6669     val iffL : int -> state -> state t/5,
6670     val iffR : int -> state -> state t/5,
6671     val allL : int -> state -> state t/5,
6672     val allR : int -> state -> state t/5,
6673     val exL : int -> state -> state t/5,
6674     val exR : int -> state -> state t/5}
6675File "sample10.sml", line 409, characters 25-69:
6676!   val conjL = propL "&" (fn (([p1,p2], ps), qs) => [(p1::p2::ps, qs)]);
6677!                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6678! Warning: pattern matching is not exhaustive
6679
6680File "sample10.sml", line 412, characters 7-62:
6681!       (fn (ps, ([q1,q2], qs)) => [(ps, q1::qs),  (ps, q2::qs)]);
6682!        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6683! Warning: pattern matching is not exhaustive
6684
6685File "sample10.sml", line 415, characters 7-62:
6686!       (fn (([p1,p2], ps), qs) => [(p1::ps, qs),  (p2::ps, qs)]);
6687!        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6688! Warning: pattern matching is not exhaustive
6689
6690File "sample10.sml", line 417, characters 25-69:
6691!   val disjR = propR "|" (fn (ps, ([q1,q2], qs)) => [(ps, q1::q2::qs)]);
6692!                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6693! Warning: pattern matching is not exhaustive
6694
6695File "sample10.sml", line 420, characters 7-62:
6696!       (fn (([p1,p2], ps), qs) => [(p2::ps, qs),  (ps, p1::qs)]);
6697!        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6698! Warning: pattern matching is not exhaustive
6699
6700File "sample10.sml", line 422, characters 26-70:
6701!   val impR = propR "-->" (fn (ps, ([q1,q2], qs)) => [(q1::ps, q2::qs)]);
6702!                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6703! Warning: pattern matching is not exhaustive
6704
6705File "sample10.sml", line 424, characters 24-59:
6706!   val negL = propL "~" (fn (([p], ps), qs) => [(ps, p::qs)]);
6707!                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6708! Warning: pattern matching is not exhaustive
6709
6710File "sample10.sml", line 426, characters 24-59:
6711!   val negR = propR "~" (fn (ps, ([q], qs)) => [(q::ps, qs)]);
6712!                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6713! Warning: pattern matching is not exhaustive
6714
6715File "sample10.sml", line 429, characters 7-70:
6716!       (fn (([p1,p2], ps), qs) => [(p1::p2::ps, qs),  (ps, p1::p2::qs)]);
6717!        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6718! Warning: pattern matching is not exhaustive
6719
6720File "sample10.sml", line 432, characters 7-70:
6721!       (fn (ps, ([q1,q2], qs)) => [(q1::ps, q2::qs),  (q2::ps, q1::qs)]);
6722!        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6723! Warning: pattern matching is not exhaustive
6724
6725File "sample10.sml", line 461, characters 14-48:
6726!       let val (qntForm as Fol.Quant(_,_,p), ps') = splitQuant "ALL" ps
6727!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6728! Warning: pattern matching is not exhaustive
6729
6730File "sample10.sml", line 466, characters 14-37:
6731!       let val (Fol.Quant(_,_,q), qs') = splitQuant "ALL" qs
6732!               ^^^^^^^^^^^^^^^^^^^^^^^
6733! Warning: pattern matching is not exhaustive
6734
6735File "sample10.sml", line 472, characters 14-37:
6736!       let val (Fol.Quant(_,_,p), ps') = splitQuant "EX" ps
6737!               ^^^^^^^^^^^^^^^^^^^^^^^
6738! Warning: pattern matching is not exhaustive
6739
6740File "sample10.sml", line 478, characters 14-48:
6741!       let val (qntForm as Fol.Quant(_,_,q), qs') = splitQuant "EX" qs
6742!               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6743! Warning: pattern matching is not exhaustive
6744
6745> New type names: state
6746  structure Rule :
6747  {type state = state,
6748   type tactic = state -> state t/5,
6749   val allL : int -> state -> state t/5,
6750   val allR : int -> state -> state t/5,
6751   val basic : int -> state -> state t/5,
6752   val conjL : int -> state -> state t/5,
6753   val conjR : int -> state -> state t/5,
6754   val disjL : int -> state -> state t/5,
6755   val disjR : int -> state -> state t/5,
6756   val exL : int -> state -> state t/5,
6757   val exR : int -> state -> state t/5,
6758   val final : state -> bool,
6759   val iffL : int -> state -> state t/5,
6760   val iffR : int -> state -> state t/5,
6761   val impL : int -> state -> state t/5,
6762   val impR : int -> state -> state t/5,
6763   val initial : form -> state,
6764   val main : state -> form,
6765   val negL : int -> state -> state t/5,
6766   val negR : int -> state -> state t/5,
6767   val subgoals : state -> (form list * form list) list,
6768   val unify : int -> state -> state t/5}
6769> signature COMMAND =
6770  {val goal : string -> unit,
6771   val by : (state -> state t/5) -> unit,
6772   val pr : state -> unit,
6773   val getState : unit -> state}
6774> structure Command :
6775  {val by : (state -> state t/5) -> unit,
6776   val getState : unit -> state,
6777   val goal : string -> unit,
6778   val pr : state -> unit}
6779> infix 0 |@|
6780> signature TACTICAL =
6781  /\multifun.
6782    {type ('a, 'b) multifun = ('a, 'b) multifun,
6783     val ('b, 'a, 'c) -- :
6784       ('a, 'b) multifun * ('b, 'c) multifun -> ('a, 'c) multifun,
6785     val ('a, 'b) || :
6786       ('a, 'b) multifun * ('a, 'b) multifun -> ('a, 'b) multifun,
6787     val ('a, 'b) |@| :
6788       ('a, 'b) multifun * ('a, 'b) multifun -> ('a, 'b) multifun,
6789     val 'a all : ('a, 'a) multifun,
6790     val ('a, 'b) no : ('a, 'b) multifun,
6791     val 'a try : ('a, 'a) multifun -> ('a, 'a) multifun,
6792     val 'a repeat : ('a, 'a) multifun -> ('a, 'a) multifun,
6793     val 'a repeatDeterm : ('a, 'a) multifun -> ('a, 'a) multifun,
6794     val 'a depthFirst :
6795       ('a -> bool) -> ('a, 'a) multifun -> ('a, 'a) multifun,
6796     val 'a depthIter :
6797       ('a -> bool) * int -> ('a, 'a) multifun -> ('a, 'a) multifun,
6798     val ('a, 'b, 'c) firstF :
6799       ('a -> ('b, 'c) multifun) list -> 'a -> ('b, 'c) multifun}
6800> structure Tactical :
6801  {type ('a, 'b) multifun = 'a -> 'b t/5,
6802   val ('b, 'a, 'c) -- : ('a -> 'b t/5) * ('b -> 'c t/5) -> 'a -> 'c t/5,
6803   val 'a all : 'a -> 'a t/5,
6804   val 'a depthFirst : ('a -> bool) -> ('a -> 'a t/5) -> 'a -> 'a t/5,
6805   val 'a depthIter : ('a -> bool) * int -> ('a -> 'a t/5) -> 'a -> 'a t/5,
6806   val ('a, 'b, 'c) firstF : ('a -> 'b -> 'c t/5) list -> 'a -> 'b -> 'c t/5,
6807   val ('a, 'b) no : 'a -> 'b t/5,
6808   val 'a repeat : ('a -> 'a t/5) -> 'a -> 'a t/5,
6809   val 'a repeatDeterm : ('a -> 'a t/5) -> 'a -> 'a t/5,
6810   val 'a try : ('a -> 'a t/5) -> 'a -> 'a t/5,
6811   val ('a, 'b) |@| : ('a -> 'b t/5) * ('a -> 'b t/5) -> 'a -> 'b t/5,
6812   val ('a, 'b) || : ('a -> 'b t/5) * ('a -> 'b t/5) -> 'a -> 'b t/5}
6813> signature TAC =
6814  {val safeSteps : int -> state -> state t/5,
6815   val quant : int -> state -> state t/5,
6816   val step : int -> state -> state t/5,
6817   val depth : state -> state t/5,
6818   val depthIt : int -> state -> state t/5}
6819> structure Tac :
6820  {val depth : state -> state t/5,
6821   val depthIt : int -> state -> state t/5,
6822   val quant : int -> state -> state t/5,
6823   val safeSteps : int -> state -> state t/5,
6824   val step : int -> state -> state t/5}
6825[closing file "sample10.sml"]
6826> val it = () : unit
6827[opening file "test10.sml"]
6828> val by = fn : (state -> state t/5) -> unit
6829  val getState = fn : unit -> state
6830  val goal = fn : string -> unit
6831  val pr = fn : state -> unit
6832> type ('a, 'b) multifun = 'a -> 'b t/5
6833  val ('b, 'a, 'c) -- = fn : ('a -> 'b t/5) * ('b -> 'c t/5) -> 'a -> 'c t/5
6834  val 'a all = fn : 'a -> 'a t/5
6835  val 'a depthFirst = fn : ('a -> bool) -> ('a -> 'a t/5) -> 'a -> 'a t/5
6836  val 'a depthIter = fn : ('a -> bool) * int -> ('a -> 'a t/5) -> 'a -> 'a t/5
6837  val ('a, 'b, 'c) firstF = fn :
6838  ('a -> 'b -> 'c t/5) list -> 'a -> 'b -> 'c t/5
6839  val ('a, 'b) no = fn : 'a -> 'b t/5
6840  val 'a repeat = fn : ('a -> 'a t/5) -> 'a -> 'a t/5
6841  val 'a repeatDeterm = fn : ('a -> 'a t/5) -> 'a -> 'a t/5
6842  val 'a try = fn : ('a -> 'a t/5) -> 'a -> 'a t/5
6843  val ('a, 'b) |@| = fn : ('a -> 'b t/5) * ('a -> 'b t/5) -> 'a -> 'b t/5
6844  val ('a, 'b) || = fn : ('a -> 'b t/5) * ('a -> 'b t/5) -> 'a -> 'b t/5
6845> val showResult = fn : unit -> unit
6846> val checkFailed = fn : unit -> string
6847P & Q --> Q & P
6848 1. empty  |-  P & Q --> Q & P
6849> val it = () : unit
6850P & Q --> Q & P
6851 1. P & Q  |-  Q & P
6852> val it = () : unit
6853P & Q --> Q & P
6854 1. P, Q  |-  Q & P
6855> val it = () : unit
6856P & Q --> Q & P
6857 1. P, Q  |-  Q
6858 2. P, Q  |-  P
6859> val it = () : unit
6860P & Q --> Q & P
6861 1. P, Q  |-  Q
6862> val it = () : unit
6863P & Q --> Q & P
6864No subgoals left!
6865> val it = () : unit
6866P & Q --> Q & P
6867> val it = () : unit
6868(ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6869 1. empty
6870    |-  (ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6871> val it = () : unit
6872(ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6873 1. ALL x. P(x)  |-  ALL x. P(x) | Q(x)
6874> val it = () : unit
6875(ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6876 1. ALL x. P(x)  |-  P(_a) | Q(_a)
6877> val it = () : unit
6878(ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6879 1. ALL x. P(x)  |-  P(_a), Q(_a)
6880> val it = () : unit
6881(ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6882 1. P(?_b), ALL x. P(x)  |-  P(_a), Q(_a)
6883> val it = () : unit
6884(ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6885No subgoals left!
6886> val it = () : unit
6887(ALL x. P(x)) --> (ALL x. P(x) | Q(x))
6888> val it = () : unit
6889EX z. P(z) --> (ALL x. P(x))
6890 1. empty  |-  EX z. P(z) --> (ALL x. P(x))
6891> val it = () : unit
6892EX z. P(z) --> (ALL x. P(x))
6893 1. empty
6894    |-  P(?_a) --> (ALL x. P(x)),
6895        EX z. P(z) --> (ALL x. P(x))
6896> val it = () : unit
6897EX z. P(z) --> (ALL x. P(x))
6898 1. P(?_a)
6899    |-  ALL x. P(x), EX z. P(z) --> (ALL x. P(x))
6900> val it = () : unit
6901EX z. P(z) --> (ALL x. P(x))
6902 1. P(?_a)
6903    |-  P(_b), EX z. P(z) --> (ALL x. P(x))
6904_b not in  ?_a
6905> val it = () : unit
6906** Tactic FAILED! **
6907> val it = () : unit
6908EX z. P(z) --> (ALL x. P(x))
6909 1. P(?_a)
6910    |-  P(?_c) --> (ALL x. P(x)), P(_b),
6911        EX z. P(z) --> (ALL x. P(x))
6912_b not in  ?_a
6913> val it = () : unit
6914EX z. P(z) --> (ALL x. P(x))
6915 1. P(?_c), P(?_a)
6916    |-  ALL x. P(x), P(_b),
6917        EX z. P(z) --> (ALL x. P(x))
6918_b not in  ?_a
6919> val it = () : unit
6920EX z. P(z) --> (ALL x. P(x))
6921No subgoals left!
6922> val it = () : unit
6923EX z. P(z) --> (ALL x. P(x))
6924> val it = () : unit
6925(P & Q) & R --> P & (Q & R)
6926 1. empty  |-  (P & Q) & R --> P & (Q & R)
6927> val it = () : unit
6928(P & Q) & R --> P & (Q & R)
6929 1. (P & Q) & R  |-  P & (Q & R)
6930> val it = () : unit
6931(P & Q) & R --> P & (Q & R)
6932 1. P & Q, R  |-  P & (Q & R)
6933> val it = () : unit
6934(P & Q) & R --> P & (Q & R)
6935 1. P, Q, R  |-  P & (Q & R)
6936> val it = () : unit
6937(P & Q) & R --> P & (Q & R)
6938 1. P, Q, R  |-  P
6939 2. P, Q, R  |-  Q & R
6940> val it = () : unit
6941(P & Q) & R --> P & (Q & R)
6942 1. P, Q, R  |-  P
6943 2. P, Q, R  |-  Q
6944 3. P, Q, R  |-  R
6945> val it = () : unit
6946(P & Q) & R --> P & (Q & R)
6947 1. P, Q, R  |-  Q
6948 2. P, Q, R  |-  R
6949> val it = () : unit
6950(P & Q) & R --> P & (Q & R)
6951 1. P, Q, R  |-  R
6952> val it = () : unit
6953(P & Q) & R --> P & (Q & R)
6954No subgoals left!
6955> val it = () : unit
6956(P & Q) & R --> P & (Q & R)
6957> val it = () : unit
6958(P & Q) & R --> P & (Q & R)
6959 1. empty  |-  (P & Q) & R --> P & (Q & R)
6960> val it = () : unit
6961(P & Q) & R --> P & (Q & R)
6962 1. P, Q, R  |-  P & (Q & R)
6963> val it = () : unit
6964(P & Q) & R --> P & (Q & R)
6965No subgoals left!
6966> val it = () : unit
6967(P & Q) & R --> P & (Q & R)
6968> val it = () : unit
6969EX z. P(z) --> (ALL x. P(x))
6970 1. empty  |-  EX z. P(z) --> (ALL x. P(x))
6971> val it = () : unit
6972EX z. P(z) --> (ALL x. P(x))
6973No subgoals left!
6974> val it = () : unit
6975EX z. P(z) --> (ALL x. P(x))
6976> val it = () : unit
6977P & Q | R --> (P | R) & (Q | R)
6978 1. empty  |-  P & Q | R --> (P | R) & (Q | R)
6979> val it = () : unit
6980P & Q | R --> (P | R) & (Q | R)
6981 1. P & Q | R  |-  (P | R) & (Q | R)
6982> val it = () : unit
6983P & Q | R --> (P | R) & (Q | R)
6984 1. P & Q  |-  (P | R) & (Q | R)
6985 2. R  |-  (P | R) & (Q | R)
6986> val it = () : unit
6987P & Q | R --> (P | R) & (Q | R)
6988 1. P, Q  |-  (P | R) & (Q | R)
6989 2. R  |-  (P | R) & (Q | R)
6990> val it = () : unit
6991P & Q | R --> (P | R) & (Q | R)
6992 1. P, Q  |-  P | R
6993 2. P, Q  |-  Q | R
6994 3. R  |-  (P | R) & (Q | R)
6995> val it = () : unit
6996P & Q | R --> (P | R) & (Q | R)
6997 1. P, Q  |-  P, R
6998 2. P, Q  |-  Q | R
6999 3. R  |-  (P | R) & (Q | R)
7000> val it = () : unit
7001P & Q | R --> (P | R) & (Q | R)
7002 1. P, Q  |-  P, R
7003 2. P, Q  |-  Q, R
7004 3. R  |-  (P | R) & (Q | R)
7005> val it = () : unit
7006P & Q | R --> (P | R) & (Q | R)
7007 1. P, Q  |-  P, R
7008 2. P, Q  |-  Q, R
7009 3. R  |-  P | R
7010 4. R  |-  Q | R
7011> val it = () : unit
7012P & Q | R --> (P | R) & (Q | R)
7013 1. P, Q  |-  P, R
7014 2. P, Q  |-  Q, R
7015 3. R  |-  P, R
7016 4. R  |-  Q | R
7017> val it = () : unit
7018P & Q | R --> (P | R) & (Q | R)
7019 1. P, Q  |-  P, R
7020 2. P, Q  |-  Q, R
7021 3. R  |-  P, R
7022 4. R  |-  Q, R
7023> val it = () : unit
7024P & Q | R --> (P | R) & (Q | R)
7025 1. P, Q  |-  Q, R
7026 2. R  |-  P, R
7027 3. R  |-  Q, R
7028> val it = () : unit
7029P & Q | R --> (P | R) & (Q | R)
7030 1. R  |-  P, R
7031 2. R  |-  Q, R
7032> val it = () : unit
7033P & Q | R --> (P | R) & (Q | R)
7034 1. R  |-  Q, R
7035> val it = () : unit
7036P & Q | R --> (P | R) & (Q | R)
7037No subgoals left!
7038> val it = () : unit
7039P & Q | R --> (P | R) & (Q | R)
7040> val it = () : unit
7041(ALL x. P(x) & Q(x)) <->
7042(ALL x. P(x)) & (ALL x. Q(x))
7043 1. empty
7044    |-  (ALL x. P(x) & Q(x)) <->
7045        (ALL x. P(x)) & (ALL x. Q(x))
7046> val it = () : unit
7047(ALL x. P(x) & Q(x)) <->
7048(ALL x. P(x)) & (ALL x. Q(x))
7049 1. ALL x. P(x) & Q(x)
7050    |-  (ALL x. P(x)) & (ALL x. Q(x))
7051 2. (ALL x. P(x)) & (ALL x. Q(x))
7052    |-  ALL x. P(x) & Q(x)
7053> val it = () : unit
7054(ALL x. P(x) & Q(x)) <->
7055(ALL x. P(x)) & (ALL x. Q(x))
7056 1. ALL x. P(x) & Q(x)  |-  ALL x. P(x)
7057 2. ALL x. P(x) & Q(x)  |-  ALL x. Q(x)
7058 3. (ALL x. P(x)) & (ALL x. Q(x))
7059    |-  ALL x. P(x) & Q(x)
7060> val it = () : unit
7061(ALL x. P(x) & Q(x)) <->
7062(ALL x. P(x)) & (ALL x. Q(x))
7063 1. ALL x. P(x) & Q(x)  |-  P(_a)
7064 2. ALL x. P(x) & Q(x)  |-  ALL x. Q(x)
7065 3. (ALL x. P(x)) & (ALL x. Q(x))
7066    |-  ALL x. P(x) & Q(x)
7067> val it = () : unit
7068(ALL x. P(x) & Q(x)) <->
7069(ALL x. P(x)) & (ALL x. Q(x))
7070 1. P(?_b) & Q(?_b), ALL x. P(x) & Q(x)  |-  P(_a)
7071 2. ALL x. P(x) & Q(x)  |-  ALL x. Q(x)
7072 3. (ALL x. P(x)) & (ALL x. Q(x))
7073    |-  ALL x. P(x) & Q(x)
7074> val it = () : unit
7075(ALL x. P(x) & Q(x)) <->
7076(ALL x. P(x)) & (ALL x. Q(x))
7077 1. P(?_b), Q(?_b), ALL x. P(x) & Q(x)  |-  P(_a)
7078 2. ALL x. P(x) & Q(x)  |-  ALL x. Q(x)
7079 3. (ALL x. P(x)) & (ALL x. Q(x))
7080    |-  ALL x. P(x) & Q(x)
7081> val it = () : unit
7082(ALL x. P(x) & Q(x)) <->
7083(ALL x. P(x)) & (ALL x. Q(x))
7084 1. ALL x. P(x) & Q(x)  |-  ALL x. Q(x)
7085 2. (ALL x. P(x)) & (ALL x. Q(x))
7086    |-  ALL x. P(x) & Q(x)
7087> val it = () : unit
7088(ALL x. P(x) & Q(x)) <->
7089(ALL x. P(x)) & (ALL x. Q(x))
7090 1. ALL x. P(x) & Q(x)  |-  Q(_c)
7091 2. (ALL x. P(x)) & (ALL x. Q(x))
7092    |-  ALL x. P(x) & Q(x)
7093> val it = () : unit
7094(ALL x. P(x) & Q(x)) <->
7095(ALL x. P(x)) & (ALL x. Q(x))
7096 1. P(?_d) & Q(?_d), ALL x. P(x) & Q(x)  |-  Q(_c)
7097 2. (ALL x. P(x)) & (ALL x. Q(x))
7098    |-  ALL x. P(x) & Q(x)
7099> val it = () : unit
7100(ALL x. P(x) & Q(x)) <->
7101(ALL x. P(x)) & (ALL x. Q(x))
7102 1. P(?_d), Q(?_d), ALL x. P(x) & Q(x)  |-  Q(_c)
7103 2. (ALL x. P(x)) & (ALL x. Q(x))
7104    |-  ALL x. P(x) & Q(x)
7105> val it = () : unit
7106(ALL x. P(x) & Q(x)) <->
7107(ALL x. P(x)) & (ALL x. Q(x))
7108 1. (ALL x. P(x)) & (ALL x. Q(x))
7109    |-  ALL x. P(x) & Q(x)
7110> val it = () : unit
7111(ALL x. P(x) & Q(x)) <->
7112(ALL x. P(x)) & (ALL x. Q(x))
7113 1. (ALL x. P(x)) & (ALL x. Q(x))
7114    |-  P(_e) & Q(_e)
7115> val it = () : unit
7116(ALL x. P(x) & Q(x)) <->
7117(ALL x. P(x)) & (ALL x. Q(x))
7118 1. ALL x. P(x), ALL x. Q(x)  |-  P(_e) & Q(_e)
7119> val it = () : unit
7120(ALL x. P(x) & Q(x)) <->
7121(ALL x. P(x)) & (ALL x. Q(x))
7122 1. P(?_f), ALL x. Q(x), ALL x. P(x)
7123    |-  P(_e) & Q(_e)
7124> val it = () : unit
7125(ALL x. P(x) & Q(x)) <->
7126(ALL x. P(x)) & (ALL x. Q(x))
7127 1. Q(?_g), P(?_f), ALL x. P(x), ALL x. Q(x)
7128    |-  P(_e) & Q(_e)
7129> val it = () : unit
7130(ALL x. P(x) & Q(x)) <->
7131(ALL x. P(x)) & (ALL x. Q(x))
7132 1. Q(?_g), P(?_f), ALL x. P(x), ALL x. Q(x)
7133    |-  P(_e)
7134 2. Q(?_g), P(?_f), ALL x. P(x), ALL x. Q(x)
7135    |-  Q(_e)
7136> val it = () : unit
7137(ALL x. P(x) & Q(x)) <->
7138(ALL x. P(x)) & (ALL x. Q(x))
7139 1. Q(?_g), P(_e), ALL x. P(x), ALL x. Q(x)
7140    |-  Q(_e)
7141> val it = () : unit
7142(ALL x. P(x) & Q(x)) <->
7143(ALL x. P(x)) & (ALL x. Q(x))
7144No subgoals left!
7145> val it = () : unit
7146(ALL x. P(x) & Q(x)) <->
7147(ALL x. P(x)) & (ALL x. Q(x))
7148> val it = () : unit
7149(ALL x. P(x) & Q(x)) <->
7150(ALL x. P(x)) & (ALL x. Q(x))
7151 1. empty
7152    |-  (ALL x. P(x) & Q(x)) <->
7153        (ALL x. P(x)) & (ALL x. Q(x))
7154> val it = () : unit
7155(ALL x. P(x) & Q(x)) <->
7156(ALL x. P(x)) & (ALL x. Q(x))
7157No subgoals left!
7158> val it = () : unit
7159(ALL x. P(x) & Q(x)) <->
7160(ALL x. P(x)) & (ALL x. Q(x))
7161> val it = () : unit
7162(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7163 1. empty
7164    |-  (EX y. ALL x. Q(x, y)) -->
7165        (ALL x. EX y. Q(x, y))
7166> val it = () : unit
7167(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7168 1. EX y. ALL x. Q(x, y)  |-  ALL x. EX y. Q(x, y)
7169> val it = () : unit
7170(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7171 1. ALL x. Q(x, _a)  |-  ALL x. EX y. Q(x, y)
7172> val it = () : unit
7173(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7174 1. ALL x. Q(x, _a)  |-  EX y. Q(_b, y)
7175> val it = () : unit
7176(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7177 1. Q(?_c, _a), ALL x. Q(x, _a)
7178    |-  EX y. Q(_b, y)
7179> val it = () : unit
7180(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7181 1. Q(?_c, _a), ALL x. Q(x, _a)
7182    |-  Q(_b, ?_d), EX y. Q(_b, y)
7183> val it = () : unit
7184(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7185No subgoals left!
7186> val it = () : unit
7187(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7188> val it = () : unit
7189(ALL x. EX y. Q(x, y)) --> (EX y. ALL x. Q(x, y))
7190 1. empty
7191    |-  (ALL x. EX y. Q(x, y)) -->
7192        (EX y. ALL x. Q(x, y))
7193> val it = () : unit
7194(ALL x. EX y. Q(x, y)) --> (EX y. ALL x. Q(x, y))
7195 1. ALL x. EX y. Q(x, y)  |-  EX y. ALL x. Q(x, y)
7196> val it = () : unit
7197(ALL x. EX y. Q(x, y)) --> (EX y. ALL x. Q(x, y))
7198 1. EX y. Q(?_a, y), ALL x. EX y. Q(x, y)
7199    |-  EX y. ALL x. Q(x, y)
7200> val it = () : unit
7201(ALL x. EX y. Q(x, y)) --> (EX y. ALL x. Q(x, y))
7202 1. Q(?_a, _b), ALL x. EX y. Q(x, y)
7203    |-  EX y. ALL x. Q(x, y)
7204_b not in  ?_a
7205> val it = () : unit
7206(ALL x. EX y. Q(x, y)) --> (EX y. ALL x. Q(x, y))
7207 1. Q(?_a, _b), ALL x. EX y. Q(x, y)
7208    |-  ALL x. Q(x, ?_c), EX y. ALL x. Q(x, y)
7209_b not in  ?_a
7210> val it = () : unit
7211(ALL x. EX y. Q(x, y)) --> (EX y. ALL x. Q(x, y))
7212 1. Q(?_a, _b), ALL x. EX y. Q(x, y)
7213    |-  Q(_d, ?_c), EX y. ALL x. Q(x, y)
7214_b not in  ?_a
7215_d not in  ?_a ?_c
7216> val it = () : unit
7217** Tactic FAILED! **
7218> val it = () : unit
7219> val it = "Failed, as expected..." : string
7220(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7221 1. empty
7222    |-  (EX x. P(x) --> Q) <->
7223        ((ALL x. P(x)) --> Q)
7224> val it = () : unit
7225(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7226 1. EX x. P(x) --> Q  |-  (ALL x. P(x)) --> Q
7227 2. (ALL x. P(x)) --> Q  |-  EX x. P(x) --> Q
7228> val it = () : unit
7229(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7230 1. ALL x. P(x), EX x. P(x) --> Q  |-  Q
7231 2. (ALL x. P(x)) --> Q  |-  EX x. P(x) --> Q
7232> val it = () : unit
7233(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7234 1. P(_a) --> Q, ALL x. P(x)  |-  Q
7235 2. (ALL x. P(x)) --> Q  |-  EX x. P(x) --> Q
7236> val it = () : unit
7237(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7238 1. P(?_b), P(_a) --> Q, ALL x. P(x)  |-  Q
7239 2. (ALL x. P(x)) --> Q  |-  EX x. P(x) --> Q
7240> val it = () : unit
7241(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7242 1. Q, P(?_b), ALL x. P(x)  |-  Q
7243 2. P(?_b), ALL x. P(x)  |-  P(_a), Q
7244 3. (ALL x. P(x)) --> Q  |-  EX x. P(x) --> Q
7245> val it = () : unit
7246(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7247 1. P(?_b), ALL x. P(x)  |-  P(_a), Q
7248 2. (ALL x. P(x)) --> Q  |-  EX x. P(x) --> Q
7249> val it = () : unit
7250(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7251 1. (ALL x. P(x)) --> Q  |-  EX x. P(x) --> Q
7252> val it = () : unit
7253(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7254 1. Q  |-  EX x. P(x) --> Q
7255 2. empty  |-  ALL x. P(x), EX x. P(x) --> Q
7256> val it = () : unit
7257(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7258 1. Q  |-  P(?_c) --> Q, EX x. P(x) --> Q
7259 2. empty  |-  ALL x. P(x), EX x. P(x) --> Q
7260> val it = () : unit
7261(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7262 1. P(?_c), Q  |-  Q, EX x. P(x) --> Q
7263 2. empty  |-  ALL x. P(x), EX x. P(x) --> Q
7264> val it = () : unit
7265(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7266 1. empty  |-  ALL x. P(x), EX x. P(x) --> Q
7267> val it = () : unit
7268(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7269 1. empty  |-  P(_d), EX x. P(x) --> Q
7270> val it = () : unit
7271(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7272 1. empty
7273    |-  P(?_e) --> Q, P(_d), EX x. P(x) --> Q
7274> val it = () : unit
7275(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7276 1. P(?_e)  |-  Q, P(_d), EX x. P(x) --> Q
7277> val it = () : unit
7278(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7279No subgoals left!
7280> val it = () : unit
7281(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7282> val it = () : unit
7283commutative laws of & and |
7284> val it = () : unit
7285P & Q --> Q & P
7286 1. empty  |-  P & Q --> Q & P
7287> val it = () : unit
7288P & Q --> Q & P
7289No subgoals left!
7290> val it = () : unit
7291P & Q --> Q & P
7292> val it = () : unit
7293P | Q --> Q | P
7294 1. empty  |-  P | Q --> Q | P
7295> val it = () : unit
7296P | Q --> Q | P
7297No subgoals left!
7298> val it = () : unit
7299P | Q --> Q | P
7300> val it = () : unit
7301associative laws of & and |
7302> val it = () : unit
7303(P & Q) & R --> P & (Q & R)
7304 1. empty  |-  (P & Q) & R --> P & (Q & R)
7305> val it = () : unit
7306(P & Q) & R --> P & (Q & R)
7307No subgoals left!
7308> val it = () : unit
7309(P & Q) & R --> P & (Q & R)
7310> val it = () : unit
7311(P | Q) | R --> P | (Q | R)
7312 1. empty  |-  (P | Q) | R --> P | (Q | R)
7313> val it = () : unit
7314(P | Q) | R --> P | (Q | R)
7315No subgoals left!
7316> val it = () : unit
7317(P | Q) | R --> P | (Q | R)
7318> val it = () : unit
7319distributive laws of & and |
7320> val it = () : unit
7321P & Q | R --> (P | R) & (Q | R)
7322 1. empty  |-  P & Q | R --> (P | R) & (Q | R)
7323> val it = () : unit
7324P & Q | R --> (P | R) & (Q | R)
7325No subgoals left!
7326> val it = () : unit
7327P & Q | R --> (P | R) & (Q | R)
7328> val it = () : unit
7329(P | R) & (Q | R) --> P & Q | R
7330 1. empty  |-  (P | R) & (Q | R) --> P & Q | R
7331> val it = () : unit
7332(P | R) & (Q | R) --> P & Q | R
7333No subgoals left!
7334> val it = () : unit
7335(P | R) & (Q | R) --> P & Q | R
7336> val it = () : unit
7337(P | Q) & R --> P & R | Q & R
7338 1. empty  |-  (P | Q) & R --> P & R | Q & R
7339> val it = () : unit
7340(P | Q) & R --> P & R | Q & R
7341No subgoals left!
7342> val it = () : unit
7343(P | Q) & R --> P & R | Q & R
7344> val it = () : unit
7345P & R | Q & R --> (P | Q) & R
7346 1. empty  |-  P & R | Q & R --> (P | Q) & R
7347> val it = () : unit
7348P & R | Q & R --> (P | Q) & R
7349No subgoals left!
7350> val it = () : unit
7351P & R | Q & R --> (P | Q) & R
7352> val it = () : unit
7353Laws involving implication
7354> val it = () : unit
7355(P --> R) & (Q --> R) <-> (P | Q --> R)
7356 1. empty
7357    |-  (P --> R) & (Q --> R) <-> (P | Q --> R)
7358> val it = () : unit
7359(P --> R) & (Q --> R) <-> (P | Q --> R)
7360No subgoals left!
7361> val it = () : unit
7362(P --> R) & (Q --> R) <-> (P | Q --> R)
7363> val it = () : unit
7364(P & Q --> R) <-> (P --> (Q --> R))
7365 1. empty  |-  (P & Q --> R) <-> (P --> (Q --> R))
7366> val it = () : unit
7367(P & Q --> R) <-> (P --> (Q --> R))
7368No subgoals left!
7369> val it = () : unit
7370(P & Q --> R) <-> (P --> (Q --> R))
7371> val it = () : unit
7372((P --> R) --> R) -->
7373(((Q --> R) --> R) --> ((P & Q --> R) --> R))
7374 1. empty
7375    |-  ((P --> R) --> R) -->
7376        (((Q --> R) --> R) -->
7377         ((P & Q --> R) --> R))
7378> val it = () : unit
7379((P --> R) --> R) -->
7380(((Q --> R) --> R) --> ((P & Q --> R) --> R))
7381No subgoals left!
7382> val it = () : unit
7383((P --> R) --> R) -->
7384(((Q --> R) --> R) --> ((P & Q --> R) --> R))
7385> val it = () : unit
7386~(P --> R) --> (~(Q --> R) --> ~((P & Q) --> R))
7387 1. empty
7388    |-  ~(P --> R) -->
7389        (~(Q --> R) --> ~((P & Q) --> R))
7390> val it = () : unit
7391~(P --> R) --> (~(Q --> R) --> ~((P & Q) --> R))
7392No subgoals left!
7393> val it = () : unit
7394~(P --> R) --> (~(Q --> R) --> ~((P & Q) --> R))
7395> val it = () : unit
7396(P --> Q & R) <-> (P --> Q) & (P --> R)
7397 1. empty
7398    |-  (P --> Q & R) <-> (P --> Q) & (P --> R)
7399> val it = () : unit
7400(P --> Q & R) <-> (P --> Q) & (P --> R)
7401No subgoals left!
7402> val it = () : unit
7403(P --> Q & R) <-> (P --> Q) & (P --> R)
7404> val it = () : unit
7405Propositions-as-types
7406> val it = () : unit
7407P --> (Q --> P)
7408 1. empty  |-  P --> (Q --> P)
7409> val it = () : unit
7410P --> (Q --> P)
7411No subgoals left!
7412> val it = () : unit
7413P --> (Q --> P)
7414> val it = () : unit
7415(P --> (Q --> R)) --> ((P --> Q) --> (P --> R))
7416 1. empty
7417    |-  (P --> (Q --> R)) -->
7418        ((P --> Q) --> (P --> R))
7419> val it = () : unit
7420(P --> (Q --> R)) --> ((P --> Q) --> (P --> R))
7421No subgoals left!
7422> val it = () : unit
7423(P --> (Q --> R)) --> ((P --> Q) --> (P --> R))
7424> val it = () : unit
7425(P --> Q) | (P --> R) --> (P --> Q | R)
7426 1. empty
7427    |-  (P --> Q) | (P --> R) --> (P --> Q | R)
7428> val it = () : unit
7429(P --> Q) | (P --> R) --> (P --> Q | R)
7430No subgoals left!
7431> val it = () : unit
7432(P --> Q) | (P --> R) --> (P --> Q | R)
7433> val it = () : unit
7434(P --> Q) --> (~Q --> ~P)
7435 1. empty  |-  (P --> Q) --> (~Q --> ~P)
7436> val it = () : unit
7437(P --> Q) --> (~Q --> ~P)
7438No subgoals left!
7439> val it = () : unit
7440(P --> Q) --> (~Q --> ~P)
7441> val it = () : unit
7442Classical examples
7443> val it = () : unit
7444(P --> Q | R) --> (P --> Q) | (P --> R)
7445 1. empty
7446    |-  (P --> Q | R) --> (P --> Q) | (P --> R)
7447> val it = () : unit
7448(P --> Q | R) --> (P --> Q) | (P --> R)
7449No subgoals left!
7450> val it = () : unit
7451(P --> Q | R) --> (P --> Q) | (P --> R)
7452> val it = () : unit
7453(P <-> Q) <-> (Q <-> P)
7454 1. empty  |-  (P <-> Q) <-> (Q <-> P)
7455> val it = () : unit
7456(P <-> Q) <-> (Q <-> P)
7457No subgoals left!
7458> val it = () : unit
7459(P <-> Q) <-> (Q <-> P)
7460> val it = () : unit
7461~(P <-> ~P)
7462 1. empty  |-  ~(P <-> ~P)
7463> val it = () : unit
7464~(P <-> ~P)
7465No subgoals left!
7466> val it = () : unit
7467~(P <-> ~P)
7468> val it = () : unit
7469*** Quantifier examples ***
7470> val it = () : unit
7471(ALL x. ALL y. P(x, y)) -->
7472(ALL y. ALL x. P(x, y))
7473 1. empty
7474    |-  (ALL x. ALL y. P(x, y)) -->
7475        (ALL y. ALL x. P(x, y))
7476> val it = () : unit
7477(ALL x. ALL y. P(x, y)) -->
7478(ALL y. ALL x. P(x, y))
7479No subgoals left!
7480> val it = () : unit
7481(ALL x. ALL y. P(x, y)) -->
7482(ALL y. ALL x. P(x, y))
7483> val it = () : unit
7484(EX x. EX y. P(x, y)) --> (EX y. EX x. P(x, y))
7485 1. empty
7486    |-  (EX x. EX y. P(x, y)) -->
7487        (EX y. EX x. P(x, y))
7488> val it = () : unit
7489(EX x. EX y. P(x, y)) --> (EX y. EX x. P(x, y))
7490No subgoals left!
7491> val it = () : unit
7492(EX x. EX y. P(x, y)) --> (EX y. EX x. P(x, y))
7493> val it = () : unit
7494(ALL x. P(x)) | (ALL x. Q(x)) -->
7495(ALL x. P(x) | Q(x))
7496 1. empty
7497    |-  (ALL x. P(x)) | (ALL x. Q(x)) -->
7498        (ALL x. P(x) | Q(x))
7499> val it = () : unit
7500(ALL x. P(x)) | (ALL x. Q(x)) -->
7501(ALL x. P(x) | Q(x))
7502No subgoals left!
7503> val it = () : unit
7504(ALL x. P(x)) | (ALL x. Q(x)) -->
7505(ALL x. P(x) | Q(x))
7506> val it = () : unit
7507(ALL x. P --> Q(x)) <-> (P --> (ALL x. Q(x)))
7508 1. empty
7509    |-  (ALL x. P --> Q(x)) <->
7510        (P --> (ALL x. Q(x)))
7511> val it = () : unit
7512(ALL x. P --> Q(x)) <-> (P --> (ALL x. Q(x)))
7513No subgoals left!
7514> val it = () : unit
7515(ALL x. P --> Q(x)) <-> (P --> (ALL x. Q(x)))
7516> val it = () : unit
7517(ALL x. P(x) --> Q) <-> ((EX x. P(x)) --> Q)
7518 1. empty
7519    |-  (ALL x. P(x) --> Q) <->
7520        ((EX x. P(x)) --> Q)
7521> val it = () : unit
7522(ALL x. P(x) --> Q) <-> ((EX x. P(x)) --> Q)
7523No subgoals left!
7524> val it = () : unit
7525(ALL x. P(x) --> Q) <-> ((EX x. P(x)) --> Q)
7526> val it = () : unit
7527Some harder ones
7528> val it = () : unit
7529(EX x. P(x) | Q(x)) <->
7530(EX x. P(x)) | (EX x. Q(x))
7531 1. empty
7532    |-  (EX x. P(x) | Q(x)) <->
7533        (EX x. P(x)) | (EX x. Q(x))
7534> val it = () : unit
7535(EX x. P(x) | Q(x)) <->
7536(EX x. P(x)) | (EX x. Q(x))
7537No subgoals left!
7538> val it = () : unit
7539(EX x. P(x) | Q(x)) <->
7540(EX x. P(x)) | (EX x. Q(x))
7541> val it = () : unit
7542(EX x. P(x) & Q(x)) -->
7543(EX x. P(x)) & (EX x. Q(x))
7544 1. empty
7545    |-  (EX x. P(x) & Q(x)) -->
7546        (EX x. P(x)) & (EX x. Q(x))
7547> val it = () : unit
7548(EX x. P(x) & Q(x)) -->
7549(EX x. P(x)) & (EX x. Q(x))
7550No subgoals left!
7551> val it = () : unit
7552(EX x. P(x) & Q(x)) -->
7553(EX x. P(x)) & (EX x. Q(x))
7554> val it = () : unit
7555Basic test of quantifier reasoning
7556> val it = () : unit
7557(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7558 1. empty
7559    |-  (EX y. ALL x. Q(x, y)) -->
7560        (ALL x. EX y. Q(x, y))
7561> val it = () : unit
7562(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7563No subgoals left!
7564> val it = () : unit
7565(EX y. ALL x. Q(x, y)) --> (ALL x. EX y. Q(x, y))
7566> val it = () : unit
7567(ALL x. Q(x)) --> (EX x. Q(x))
7568 1. empty  |-  (ALL x. Q(x)) --> (EX x. Q(x))
7569> val it = () : unit
7570(ALL x. Q(x)) --> (EX x. Q(x))
7571No subgoals left!
7572> val it = () : unit
7573(ALL x. Q(x)) --> (EX x. Q(x))
7574> val it = () : unit
7575The following should fail, as they are false!
7576> val it = () : unit
7577(EX x. Q(x)) --> (ALL x. Q(x))
7578 1. empty  |-  (EX x. Q(x)) --> (ALL x. Q(x))
7579> val it = () : unit
7580** Tactic FAILED! **
7581> val it = () : unit
7582> val it = "Failed, as expected..." : string
7583P(?a) --> (ALL x. P(x))
7584 1. empty  |-  P(?a) --> (ALL x. P(x))
7585> val it = () : unit
7586** Tactic FAILED! **
7587> val it = () : unit
7588> val it = "Failed, as expected..." : string
7589(P(?a) --> (ALL x. Q(x))) -->
7590(ALL x. P(x) --> Q(x))
7591 1. empty
7592    |-  (P(?a) --> (ALL x. Q(x))) -->
7593        (ALL x. P(x) --> Q(x))
7594> val it = () : unit
7595** Tactic FAILED! **
7596> val it = () : unit
7597> val it = "Failed, as expected..." : string
7598Back to things that are provable...
7599> val it = () : unit
7600(ALL x. P(x) --> Q(x)) & (EX x. P(x)) -->
7601(EX x. Q(x))
7602 1. empty
7603    |-  (ALL x. P(x) --> Q(x)) & (EX x. P(x)) -->
7604        (EX x. Q(x))
7605> val it = () : unit
7606(ALL x. P(x) --> Q(x)) & (EX x. P(x)) -->
7607(EX x. Q(x))
7608No subgoals left!
7609> val it = () : unit
7610(ALL x. P(x) --> Q(x)) & (EX x. P(x)) -->
7611(EX x. Q(x))
7612> val it = () : unit
7613(P --> (EX x. Q(x))) & P --> (EX x. Q(x))
7614 1. empty
7615    |-  (P --> (EX x. Q(x))) & P --> (EX x. Q(x))
7616> val it = () : unit
7617(P --> (EX x. Q(x))) & P --> (EX x. Q(x))
7618No subgoals left!
7619> val it = () : unit
7620(P --> (EX x. Q(x))) & P --> (EX x. Q(x))
7621> val it = () : unit
7622(ALL x. P(x) --> Q(f(x))) &
7623((ALL x. Q(x) --> R(g(x))) & P(d)) --> R(?a)
7624 1. empty
7625    |-  (ALL x. P(x) --> Q(f(x))) &
7626        ((ALL x. Q(x) --> R(g(x))) & P(d)) -->
7627        R(?a)
7628> val it = () : unit
7629(ALL x. P(x) --> Q(f(x))) &
7630((ALL x. Q(x) --> R(g(x))) & P(d)) --> R(g(f(d)))
7631No subgoals left!
7632> val it = () : unit
7633(ALL x. P(x) --> Q(f(x))) &
7634((ALL x. Q(x) --> R(g(x))) & P(d)) --> R(g(f(d)))
7635> val it = () : unit
7636(ALL x. Q(x)) --> (EX x. Q(x))
7637 1. empty  |-  (ALL x. Q(x)) --> (EX x. Q(x))
7638> val it = () : unit
7639(ALL x. Q(x)) --> (EX x. Q(x))
7640No subgoals left!
7641> val it = () : unit
7642(ALL x. Q(x)) --> (EX x. Q(x))
7643> val it = () : unit
7644Classical Logic: examples with quantifiers.
7645> val it = () : unit
7646(ALL x. P(x) & Q(x)) <->
7647(ALL x. P(x)) & (ALL x. Q(x))
7648 1. empty
7649    |-  (ALL x. P(x) & Q(x)) <->
7650        (ALL x. P(x)) & (ALL x. Q(x))
7651> val it = () : unit
7652(ALL x. P(x) & Q(x)) <->
7653(ALL x. P(x)) & (ALL x. Q(x))
7654No subgoals left!
7655> val it = () : unit
7656(ALL x. P(x) & Q(x)) <->
7657(ALL x. P(x)) & (ALL x. Q(x))
7658> val it = () : unit
7659(EX x. P --> Q(x)) <-> (P --> (EX x. Q(x)))
7660 1. empty
7661    |-  (EX x. P --> Q(x)) <->
7662        (P --> (EX x. Q(x)))
7663> val it = () : unit
7664(EX x. P --> Q(x)) <-> (P --> (EX x. Q(x)))
7665No subgoals left!
7666> val it = () : unit
7667(EX x. P --> Q(x)) <-> (P --> (EX x. Q(x)))
7668> val it = () : unit
7669(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7670 1. empty
7671    |-  (EX x. P(x) --> Q) <->
7672        ((ALL x. P(x)) --> Q)
7673> val it = () : unit
7674(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7675No subgoals left!
7676> val it = () : unit
7677(EX x. P(x) --> Q) <-> ((ALL x. P(x)) --> Q)
7678> val it = () : unit
7679(ALL x. P(x)) | Q <-> (ALL x. P(x) | Q)
7680 1. empty
7681    |-  (ALL x. P(x)) | Q <-> (ALL x. P(x) | Q)
7682> val it = () : unit
7683(ALL x. P(x)) | Q <-> (ALL x. P(x) | Q)
7684No subgoals left!
7685> val it = () : unit
7686(ALL x. P(x)) | Q <-> (ALL x. P(x) | Q)
7687> val it = () : unit
7688Harder proofs
7689> val it = () : unit
7690(ALL x. P(x) --> P(f(x))) & P(d) --> P(f(f(f(d))))
7691 1. empty
7692    |-  (ALL x. P(x) --> P(f(x))) & P(d) -->
7693        P(f(f(f(d))))
7694> val it = () : unit
7695(ALL x. P(x) --> P(f(x))) & P(d) --> P(f(f(f(d))))
7696No subgoals left!
7697> val it = () : unit
7698(ALL x. P(x) --> P(f(x))) & P(d) --> P(f(f(f(d))))
7699> val it = () : unit
7700EX x. P(x) --> P(a) & P(b)
7701 1. empty  |-  EX x. P(x) --> P(a) & P(b)
7702> val it = () : unit
7703EX x. P(x) --> P(a) & P(b)
7704No subgoals left!
7705> val it = () : unit
7706EX x. P(x) --> P(a) & P(b)
7707> val it = () : unit
7708EX z. P(z) --> (ALL x. P(x))
7709 1. empty  |-  EX z. P(z) --> (ALL x. P(x))
7710> val it = () : unit
7711EX z. P(z) --> (ALL x. P(x))
7712No subgoals left!
7713> val it = () : unit
7714EX z. P(z) --> (ALL x. P(x))
7715> val it = () : unit
7716Some slow ones
7717> val it = () : unit
7718(ALL x. ALL y. P(x) --> Q(y)) <->
7719((EX x. P(x)) --> (ALL y. Q(y)))
7720 1. empty
7721    |-  (ALL x. ALL y. P(x) --> Q(y)) <->
7722        ((EX x. P(x)) --> (ALL y. Q(y)))
7723> val it = () : unit
7724(ALL x. ALL y. P(x) --> Q(y)) <->
7725((EX x. P(x)) --> (ALL y. Q(y)))
7726No subgoals left!
7727> val it = () : unit
7728(ALL x. ALL y. P(x) --> Q(y)) <->
7729((EX x. P(x)) --> (ALL y. Q(y)))
7730> val it = () : unit
7731(EX x. EX y. P(x) & Q(x, y)) <->
7732(EX x. P(x) & (EX y. Q(x, y)))
7733 1. empty
7734    |-  (EX x. EX y. P(x) & Q(x, y)) <->
7735        (EX x. P(x) & (EX y. Q(x, y)))
7736> val it = () : unit
7737(EX x. EX y. P(x) & Q(x, y)) <->
7738(EX x. P(x) & (EX y. Q(x, y)))
7739No subgoals left!
7740> val it = () : unit
7741(EX x. EX y. P(x) & Q(x, y)) <->
7742(EX x. P(x) & (EX y. Q(x, y)))
7743> val it = () : unit
7744(EX y. ALL x. P(x) --> Q(x, y)) -->
7745(ALL x. P(x) --> (EX y. Q(x, y)))
7746 1. empty
7747    |-  (EX y. ALL x. P(x) --> Q(x, y)) -->
7748        (ALL x. P(x) --> (EX y. Q(x, y)))
7749> val it = () : unit
7750(EX y. ALL x. P(x) --> Q(x, y)) -->
7751(ALL x. P(x) --> (EX y. Q(x, y)))
7752No subgoals left!
7753> val it = () : unit
7754(EX y. ALL x. P(x) --> Q(x, y)) -->
7755(ALL x. P(x) --> (EX y. Q(x, y)))
7756> val it = () : unit
7757(EX z. P(z)) & (EX w. Q(w)) -->
7758((ALL z. P(z) --> R(z)) &
7759 (ALL w. Q(w) --> S(w)) <->
7760 (ALL z. ALL w. P(z) & Q(w) --> R(z) & S(w)))
7761 1. empty
7762    |-  (EX z. P(z)) & (EX w. Q(w)) -->
7763        ((ALL z. P(z) --> R(z)) &
7764         (ALL w. Q(w) --> S(w)) <->
7765         (ALL z.
7766            ALL w. P(z) & Q(w) --> R(z) & S(w)))
7767> val it = () : unit
7768(EX z. P(z)) & (EX w. Q(w)) -->
7769((ALL z. P(z) --> R(z)) &
7770 (ALL w. Q(w) --> S(w)) <->
7771 (ALL z. ALL w. P(z) & Q(w) --> R(z) & S(w)))
7772No subgoals left!
7773> val it = () : unit
7774(EX z. P(z)) & (EX w. Q(w)) -->
7775((ALL z. P(z) --> R(z)) &
7776 (ALL w. Q(w) --> S(w)) <->
7777 (ALL z. ALL w. P(z) & Q(w) --> R(z) & S(w)))
7778> val it = () : unit
7779EX x.
7780  EX X.
7781    ALL y.
7782      EX z.
7783        EX Z.
7784          (~P(y, y) | (P(x, x) | ~S(z, x))) &
7785          ((S(x, y) | (~S(y, z) | Q(Z, Z))) &
7786           (Q(X, y) | (~Q(y, Z) | S(X, X))))
7787 1. empty
7788    |-  EX x.
7789          EX X.
7790            ALL y.
7791              EX z.
7792                EX Z.
7793                  (~P(y, y) |
7794                   (P(x, x) | ~S(z, x))) &
7795                  ((S(x, y) |
7796                    (~S(y, z) | Q(Z, Z))) &
7797                   (Q(X, y) |
7798                    (~Q(y, Z) | S(X, X))))
7799> val it = () : unit
7800Pelletier's examples
7801> val it = () : unit
7802(P --> Q) <-> (~Q --> ~P)
7803 1. empty  |-  (P --> Q) <-> (~Q --> ~P)
7804> val it = () : unit
7805(P --> Q) <-> (~Q --> ~P)
7806No subgoals left!
7807> val it = () : unit
7808(P --> Q) <-> (~Q --> ~P)
7809> val it = () : unit
7810~~P <-> P
7811 1. empty  |-  ~~P <-> P
7812> val it = () : unit
7813~~P <-> P
7814No subgoals left!
7815> val it = () : unit
7816~~P <-> P
7817> val it = () : unit
7818~(P --> Q) --> (Q --> P)
7819 1. empty  |-  ~(P --> Q) --> (Q --> P)
7820> val it = () : unit
7821~(P --> Q) --> (Q --> P)
7822No subgoals left!
7823> val it = () : unit
7824~(P --> Q) --> (Q --> P)
7825> val it = () : unit
7826(~P --> Q) <-> (~Q --> P)
7827 1. empty  |-  (~P --> Q) <-> (~Q --> P)
7828> val it = () : unit
7829(~P --> Q) <-> (~Q --> P)
7830No subgoals left!
7831> val it = () : unit
7832(~P --> Q) <-> (~Q --> P)
7833> val it = () : unit
7834(P | Q --> P | R) --> P | (Q --> R)
7835 1. empty  |-  (P | Q --> P | R) --> P | (Q --> R)
7836> val it = () : unit
7837(P | Q --> P | R) --> P | (Q --> R)
7838No subgoals left!
7839> val it = () : unit
7840(P | Q --> P | R) --> P | (Q --> R)
7841> val it = () : unit
7842P | ~P
7843 1. empty  |-  P | ~P
7844> val it = () : unit
7845P | ~P
7846No subgoals left!
7847> val it = () : unit
7848P | ~P
7849> val it = () : unit
7850P | ~~~P
7851 1. empty  |-  P | ~~~P
7852> val it = () : unit
7853P | ~~~P
7854No subgoals left!
7855> val it = () : unit
7856P | ~~~P
7857> val it = () : unit
7858((P --> Q) --> P) --> P
7859 1. empty  |-  ((P --> Q) --> P) --> P
7860> val it = () : unit
7861((P --> Q) --> P) --> P
7862No subgoals left!
7863> val it = () : unit
7864((P --> Q) --> P) --> P
7865> val it = () : unit
7866(P | Q) & ((~P | Q) & (P | ~Q)) --> ~(~P | ~Q)
7867 1. empty
7868    |-  (P | Q) & ((~P | Q) & (P | ~Q)) -->
7869        ~(~P | ~Q)
7870> val it = () : unit
7871(P | Q) & ((~P | Q) & (P | ~Q)) --> ~(~P | ~Q)
7872No subgoals left!
7873> val it = () : unit
7874(P | Q) & ((~P | Q) & (P | ~Q)) --> ~(~P | ~Q)
7875> val it = () : unit
7876(Q --> R) &
7877((R --> (P & Q)) & (P --> (Q | R))) --> (P <-> Q)
7878 1. empty
7879    |-  (Q --> R) &
7880        ((R --> (P & Q)) & (P --> (Q | R))) -->
7881        (P <-> Q)
7882> val it = () : unit
7883(Q --> R) &
7884((R --> (P & Q)) & (P --> (Q | R))) --> (P <-> Q)
7885No subgoals left!
7886> val it = () : unit
7887(Q --> R) &
7888((R --> (P & Q)) & (P --> (Q | R))) --> (P <-> Q)
7889> val it = () : unit
7890P <-> P
7891 1. empty  |-  P <-> P
7892> val it = () : unit
7893P <-> P
7894No subgoals left!
7895> val it = () : unit
7896P <-> P
7897> val it = () : unit
7898((P <-> Q) <-> R) <-> (P <-> (Q <-> R))
7899 1. empty
7900    |-  ((P <-> Q) <-> R) <-> (P <-> (Q <-> R))
7901> val it = () : unit
7902((P <-> Q) <-> R) <-> (P <-> (Q <-> R))
7903No subgoals left!
7904> val it = () : unit
7905((P <-> Q) <-> R) <-> (P <-> (Q <-> R))
7906> val it = () : unit
7907P | Q & R <-> (P | Q) & (P | R)
7908 1. empty  |-  P | Q & R <-> (P | Q) & (P | R)
7909> val it = () : unit
7910P | Q & R <-> (P | Q) & (P | R)
7911No subgoals left!
7912> val it = () : unit
7913P | Q & R <-> (P | Q) & (P | R)
7914> val it = () : unit
7915(P <-> Q) <-> (Q | ~P) & (~Q | P)
7916 1. empty  |-  (P <-> Q) <-> (Q | ~P) & (~Q | P)
7917> val it = () : unit
7918(P <-> Q) <-> (Q | ~P) & (~Q | P)
7919No subgoals left!
7920> val it = () : unit
7921(P <-> Q) <-> (Q | ~P) & (~Q | P)
7922> val it = () : unit
7923(P --> Q) <-> ~P | Q
7924 1. empty  |-  (P --> Q) <-> ~P | Q
7925> val it = () : unit
7926(P --> Q) <-> ~P | Q
7927No subgoals left!
7928> val it = () : unit
7929(P --> Q) <-> ~P | Q
7930> val it = () : unit
7931(P --> Q) | (Q --> P)
7932 1. empty  |-  (P --> Q) | (Q --> P)
7933> val it = () : unit
7934(P --> Q) | (Q --> P)
7935No subgoals left!
7936> val it = () : unit
7937(P --> Q) | (Q --> P)
7938> val it = () : unit
7939(P & (Q --> R) --> S) <->
7940(~P | (Q | S)) & (~P | (~R | S))
7941 1. empty
7942    |-  (P & (Q --> R) --> S) <->
7943        (~P | (Q | S)) & (~P | (~R | S))
7944> val it = () : unit
7945(P & (Q --> R) --> S) <->
7946(~P | (Q | S)) & (~P | (~R | S))
7947No subgoals left!
7948> val it = () : unit
7949(P & (Q --> R) --> S) <->
7950(~P | (Q | S)) & (~P | (~R | S))
7951> val it = () : unit
7952Problem 18.
7953> val it = () : unit
7954EX y. ALL x. P(y) --> P(x)
7955 1. empty  |-  EX y. ALL x. P(y) --> P(x)
7956> val it = () : unit
7957EX y. ALL x. P(y) --> P(x)
7958No subgoals left!
7959> val it = () : unit
7960EX y. ALL x. P(y) --> P(x)
7961> val it = () : unit
7962Problem 19.
7963> val it = () : unit
7964EX x.
7965  ALL y.
7966    ALL z. (P(y) --> Q(z)) --> (P(x) --> Q(x))
7967 1. empty
7968    |-  EX x.
7969          ALL y.
7970            ALL z.
7971              (P(y) --> Q(z)) --> (P(x) --> Q(x))
7972> val it = () : unit
7973EX x.
7974  ALL y.
7975    ALL z. (P(y) --> Q(z)) --> (P(x) --> Q(x))
7976No subgoals left!
7977> val it = () : unit
7978EX x.
7979  ALL y.
7980    ALL z. (P(y) --> Q(z)) --> (P(x) --> Q(x))
7981> val it = () : unit
7982Problem 20.
7983> val it = () : unit
7984(ALL x.
7985   ALL y.
7986     EX z. ALL w. P(x) & Q(y) --> R(z) & S(w)) -->
7987((EX x. EX y. P(x) & Q(y)) --> (EX z. R(z)))
7988 1. empty
7989    |-  (ALL x.
7990           ALL y.
7991             EX z.
7992               ALL w.
7993                 P(x) & Q(y) --> R(z) & S(w)) -->
7994        ((EX x. EX y. P(x) & Q(y)) -->
7995         (EX z. R(z)))
7996> val it = () : unit
7997(ALL x.
7998   ALL y.
7999     EX z. ALL w. P(x) & Q(y) --> R(z) & S(w)) -->
8000((EX x. EX y. P(x) & Q(y)) --> (EX z. R(z)))
8001No subgoals left!
8002> val it = () : unit
8003(ALL x.
8004   ALL y.
8005     EX z. ALL w. P(x) & Q(y) --> R(z) & S(w)) -->
8006((EX x. EX y. P(x) & Q(y)) --> (EX z. R(z)))
8007> val it = () : unit
8008Problem 21.
8009> val it = () : unit
8010(EX x. P --> Q(x)) & (EX x. Q(x) --> P) -->
8011(EX x. P <-> Q(x))
8012 1. empty
8013    |-  (EX x. P --> Q(x)) &
8014        (EX x. Q(x) --> P) --> (EX x. P <-> Q(x))
8015> val it = () : unit
8016(EX x. P --> Q(x)) & (EX x. Q(x) --> P) -->
8017(EX x. P <-> Q(x))
8018No subgoals left!
8019> val it = () : unit
8020(EX x. P --> Q(x)) & (EX x. Q(x) --> P) -->
8021(EX x. P <-> Q(x))
8022> val it = () : unit
8023Problem 22
8024> val it = () : unit
8025(ALL x. P <-> Q(x)) --> (P <-> (ALL x. Q(x)))
8026 1. empty
8027    |-  (ALL x. P <-> Q(x)) -->
8028        (P <-> (ALL x. Q(x)))
8029> val it = () : unit
8030(ALL x. P <-> Q(x)) --> (P <-> (ALL x. Q(x)))
8031No subgoals left!
8032> val it = () : unit
8033(ALL x. P <-> Q(x)) --> (P <-> (ALL x. Q(x)))
8034> val it = () : unit
8035Problem 23
8036> val it = () : unit
8037(ALL x. P | Q(x)) <-> P | (ALL x. Q(x))
8038 1. empty
8039    |-  (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))
8040> val it = () : unit
8041(ALL x. P | Q(x)) <-> P | (ALL x. Q(x))
8042No subgoals left!
8043> val it = () : unit
8044(ALL x. P | Q(x)) <-> P | (ALL x. Q(x))
8045> val it = () : unit
8046Problem 24
8047> val it = () : unit
8048~(EX x. S(x) & Q(x)) &
8049((ALL x. P(x) --> Q(x) | R(x)) &
8050 ((~(EX x. P(x)) --> (EX x. Q(x))) &
8051  (ALL x. Q(x) | R(x) --> S(x)))) -->
8052(EX x. P(x) & R(x))
8053 1. empty
8054    |-  ~(EX x. S(x) & Q(x)) &
8055        ((ALL x. P(x) --> Q(x) | R(x)) &
8056         ((~(EX x. P(x)) --> (EX x. Q(x))) &
8057          (ALL x. Q(x) | R(x) --> S(x)))) -->
8058        (EX x. P(x) & R(x))
8059> val it = () : unit
8060~(EX x. S(x) & Q(x)) &
8061((ALL x. P(x) --> Q(x) | R(x)) &
8062 ((~(EX x. P(x)) --> (EX x. Q(x))) &
8063  (ALL x. Q(x) | R(x) --> S(x)))) -->
8064(EX x. P(x) & R(x))
8065No subgoals left!
8066> val it = () : unit
8067~(EX x. S(x) & Q(x)) &
8068((ALL x. P(x) --> Q(x) | R(x)) &
8069 ((~(EX x. P(x)) --> (EX x. Q(x))) &
8070  (ALL x. Q(x) | R(x) --> S(x)))) -->
8071(EX x. P(x) & R(x))
8072> val it = () : unit
8073Problem 25
8074> val it = () : unit
8075(EX x. P(x)) &
8076((ALL x. L(x) --> ~(M(x) & R(x))) &
8077 ((ALL x. P(x) --> M(x) & L(x)) &
8078  ((ALL x. P(x) --> Q(x)) |
8079   (EX x. P(x) & R(x))))) --> (EX x. Q(x) & P(x))
8080 1. empty
8081    |-  (EX x. P(x)) &
8082        ((ALL x. L(x) --> ~(M(x) & R(x))) &
8083         ((ALL x. P(x) --> M(x) & L(x)) &
8084          ((ALL x. P(x) --> Q(x)) |
8085           (EX x. P(x) & R(x))))) -->
8086        (EX x. Q(x) & P(x))
8087> val it = () : unit
8088(EX x. P(x)) &
8089((ALL x. L(x) --> ~(M(x) & R(x))) &
8090 ((ALL x. P(x) --> M(x) & L(x)) &
8091  ((ALL x. P(x) --> Q(x)) |
8092   (EX x. P(x) & R(x))))) --> (EX x. Q(x) & P(x))
8093No subgoals left!
8094> val it = () : unit
8095(EX x. P(x)) &
8096((ALL x. L(x) --> ~(M(x) & R(x))) &
8097 ((ALL x. P(x) --> M(x) & L(x)) &
8098  ((ALL x. P(x) --> Q(x)) |
8099   (EX x. P(x) & R(x))))) --> (EX x. Q(x) & P(x))
8100> val it = () : unit
8101Problem 26
8102> val it = () : unit
8103((EX x. p(x)) <-> (EX x. q(x))) &
8104(ALL x.
8105   ALL y. p(x) & q(y) --> (r(x) <-> s(y))) -->
8106((ALL x. p(x) --> r(x)) <->
8107 (ALL x. q(x) --> s(x)))
8108 1. empty
8109    |-  ((EX x. p(x)) <-> (EX x. q(x))) &
8110        (ALL x.
8111           ALL y.
8112             p(x) & q(y) --> (r(x) <-> s(y))) -->
8113        ((ALL x. p(x) --> r(x)) <->
8114         (ALL x. q(x) --> s(x)))
8115> val it = () : unit
8116((EX x. p(x)) <-> (EX x. q(x))) &
8117(ALL x.
8118   ALL y. p(x) & q(y) --> (r(x) <-> s(y))) -->
8119((ALL x. p(x) --> r(x)) <->
8120 (ALL x. q(x) --> s(x)))
8121No subgoals left!
8122> val it = () : unit
8123((EX x. p(x)) <-> (EX x. q(x))) &
8124(ALL x.
8125   ALL y. p(x) & q(y) --> (r(x) <-> s(y))) -->
8126((ALL x. p(x) --> r(x)) <->
8127 (ALL x. q(x) --> s(x)))
8128> val it = () : unit
8129Problem 27
8130> val it = () : unit
8131(EX x. P(x) & ~Q(x)) &
8132((ALL x. P(x) --> R(x)) &
8133 ((ALL x. M(x) & L(x) --> P(x)) &
8134  ((EX x. R(x) & ~Q(x)) -->
8135   (ALL x. L(x) --> ~R(x))))) -->
8136(ALL x. M(x) --> ~L(x))
8137 1. empty
8138    |-  (EX x. P(x) & ~Q(x)) &
8139        ((ALL x. P(x) --> R(x)) &
8140         ((ALL x. M(x) & L(x) --> P(x)) &
8141          ((EX x. R(x) & ~Q(x)) -->
8142           (ALL x. L(x) --> ~R(x))))) -->
8143        (ALL x. M(x) --> ~L(x))
8144> val it = () : unit
8145(EX x. P(x) & ~Q(x)) &
8146((ALL x. P(x) --> R(x)) &
8147 ((ALL x. M(x) & L(x) --> P(x)) &
8148  ((EX x. R(x) & ~Q(x)) -->
8149   (ALL x. L(x) --> ~R(x))))) -->
8150(ALL x. M(x) --> ~L(x))
8151No subgoals left!
8152> val it = () : unit
8153(EX x. P(x) & ~Q(x)) &
8154((ALL x. P(x) --> R(x)) &
8155 ((ALL x. M(x) & L(x) --> P(x)) &
8156  ((EX x. R(x) & ~Q(x)) -->
8157   (ALL x. L(x) --> ~R(x))))) -->
8158(ALL x. M(x) --> ~L(x))
8159> val it = () : unit
8160Problem 28.  AMENDED
8161> val it = () : unit
8162(ALL x. P(x) --> (ALL x. Q(x))) &
8163(((ALL x. Q(x) | R(x)) --> (EX x. Q(x) & S(x))) &
8164 ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))) -->
8165(ALL x. P(x) & L(x) --> M(x))
8166 1. empty
8167    |-  (ALL x. P(x) --> (ALL x. Q(x))) &
8168        (((ALL x. Q(x) | R(x)) -->
8169          (EX x. Q(x) & S(x))) &
8170         ((EX x. S(x)) -->
8171          (ALL x. L(x) --> M(x)))) -->
8172        (ALL x. P(x) & L(x) --> M(x))
8173> val it = () : unit
8174(ALL x. P(x) --> (ALL x. Q(x))) &
8175(((ALL x. Q(x) | R(x)) --> (EX x. Q(x) & S(x))) &
8176 ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))) -->
8177(ALL x. P(x) & L(x) --> M(x))
8178No subgoals left!
8179> val it = () : unit
8180(ALL x. P(x) --> (ALL x. Q(x))) &
8181(((ALL x. Q(x) | R(x)) --> (EX x. Q(x) & S(x))) &
8182 ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))) -->
8183(ALL x. P(x) & L(x) --> M(x))
8184> val it = () : unit
8185Problem 29.  Essentially the same as Principia Mathematica *11.71
8186> val it = () : unit
8187(EX x. P(x)) & (EX y. Q(y)) -->
8188((ALL x. P(x) --> R(x)) &
8189 (ALL y. Q(y) --> S(y)) <->
8190 (ALL x. ALL y. P(x) & Q(y) --> R(x) & S(y)))
8191 1. empty
8192    |-  (EX x. P(x)) & (EX y. Q(y)) -->
8193        ((ALL x. P(x) --> R(x)) &
8194         (ALL y. Q(y) --> S(y)) <->
8195         (ALL x.
8196            ALL y. P(x) & Q(y) --> R(x) & S(y)))
8197> val it = () : unit
8198(EX x. P(x)) & (EX y. Q(y)) -->
8199((ALL x. P(x) --> R(x)) &
8200 (ALL y. Q(y) --> S(y)) <->
8201 (ALL x. ALL y. P(x) & Q(y) --> R(x) & S(y)))
8202No subgoals left!
8203> val it = () : unit
8204(EX x. P(x)) & (EX y. Q(y)) -->
8205((ALL x. P(x) --> R(x)) &
8206 (ALL y. Q(y) --> S(y)) <->
8207 (ALL x. ALL y. P(x) & Q(y) --> R(x) & S(y)))
8208> val it = () : unit
8209Problem 30
8210> val it = () : unit
8211(ALL x. P(x) | Q(x) --> ~R(x)) &
8212(ALL x. (Q(x) --> ~S(x)) --> P(x) & R(x)) -->
8213(ALL x. S(x))
8214 1. empty
8215    |-  (ALL x. P(x) | Q(x) --> ~R(x)) &
8216        (ALL x.
8217           (Q(x) --> ~S(x)) --> P(x) & R(x)) -->
8218        (ALL x. S(x))
8219> val it = () : unit
8220(ALL x. P(x) | Q(x) --> ~R(x)) &
8221(ALL x. (Q(x) --> ~S(x)) --> P(x) & R(x)) -->
8222(ALL x. S(x))
8223No subgoals left!
8224> val it = () : unit
8225(ALL x. P(x) | Q(x) --> ~R(x)) &
8226(ALL x. (Q(x) --> ~S(x)) --> P(x) & R(x)) -->
8227(ALL x. S(x))
8228> val it = () : unit
8229Problem 31.
8230> val it = () : unit
8231~(EX x. P(x) & (Q(x) | R(x))) &
8232((EX x. L(x) & P(x)) &
8233 (ALL x. ~R(x) --> M(x))) --> (EX x. L(x) & M(x))
8234 1. empty
8235    |-  ~(EX x. P(x) & (Q(x) | R(x))) &
8236        ((EX x. L(x) & P(x)) &
8237         (ALL x. ~R(x) --> M(x))) -->
8238        (EX x. L(x) & M(x))
8239> val it = () : unit
8240~(EX x. P(x) & (Q(x) | R(x))) &
8241((EX x. L(x) & P(x)) &
8242 (ALL x. ~R(x) --> M(x))) --> (EX x. L(x) & M(x))
8243No subgoals left!
8244> val it = () : unit
8245~(EX x. P(x) & (Q(x) | R(x))) &
8246((EX x. L(x) & P(x)) &
8247 (ALL x. ~R(x) --> M(x))) --> (EX x. L(x) & M(x))
8248> val it = () : unit
8249Problem 32.
8250> val it = () : unit
8251(ALL x. P(x) & (Q(x) | R(x)) --> S(x)) &
8252((ALL x. S(x) & R(x) --> L(x)) &
8253 (ALL x. M(x) --> R(x))) -->
8254(ALL x. P(x) & M(x) --> L(x))
8255 1. empty
8256    |-  (ALL x. P(x) & (Q(x) | R(x)) --> S(x)) &
8257        ((ALL x. S(x) & R(x) --> L(x)) &
8258         (ALL x. M(x) --> R(x))) -->
8259        (ALL x. P(x) & M(x) --> L(x))
8260> val it = () : unit
8261(ALL x. P(x) & (Q(x) | R(x)) --> S(x)) &
8262((ALL x. S(x) & R(x) --> L(x)) &
8263 (ALL x. M(x) --> R(x))) -->
8264(ALL x. P(x) & M(x) --> L(x))
8265No subgoals left!
8266> val it = () : unit
8267(ALL x. P(x) & (Q(x) | R(x)) --> S(x)) &
8268((ALL x. S(x) & R(x) --> L(x)) &
8269 (ALL x. M(x) --> R(x))) -->
8270(ALL x. P(x) & M(x) --> L(x))
8271> val it = () : unit
8272Problem 33
8273> val it = () : unit
8274(ALL x. P(a) & (P(x) --> P(b)) --> P(c)) <->
8275(ALL x.
8276   (~P(a) | (P(x) | P(c))) &
8277   (~P(a) | (~P(b) | P(c))))
8278 1. empty
8279    |-  (ALL x.
8280           P(a) & (P(x) --> P(b)) --> P(c)) <->
8281        (ALL x.
8282           (~P(a) | (P(x) | P(c))) &
8283           (~P(a) | (~P(b) | P(c))))
8284> val it = () : unit
8285(ALL x. P(a) & (P(x) --> P(b)) --> P(c)) <->
8286(ALL x.
8287   (~P(a) | (P(x) | P(c))) &
8288   (~P(a) | (~P(b) | P(c))))
8289No subgoals left!
8290> val it = () : unit
8291(ALL x. P(a) & (P(x) --> P(b)) --> P(c)) <->
8292(ALL x.
8293   (~P(a) | (P(x) | P(c))) &
8294   (~P(a) | (~P(b) | P(c))))
8295> val it = () : unit
8296Problem 34  AMENDED (TWICE!!)
8297> val it = () : unit
8298((EX x. ALL y. p(x) <-> p(y)) <->
8299 ((EX x. q(x)) <-> (ALL y. p(y)))) <->
8300((EX x. ALL y. q(x) <-> q(y)) <->
8301 ((EX x. p(x)) <-> (ALL y. q(y))))
8302 1. empty
8303    |-  ((EX x. ALL y. p(x) <-> p(y)) <->
8304         ((EX x. q(x)) <-> (ALL y. p(y)))) <->
8305        ((EX x. ALL y. q(x) <-> q(y)) <->
8306         ((EX x. p(x)) <-> (ALL y. q(y))))
8307> val it = () : unit
8308((EX x. ALL y. p(x) <-> p(y)) <->
8309 ((EX x. q(x)) <-> (ALL y. p(y)))) <->
8310((EX x. ALL y. q(x) <-> q(y)) <->
8311 ((EX x. p(x)) <-> (ALL y. q(y))))
8312No subgoals left!
8313> val it = () : unit
8314((EX x. ALL y. p(x) <-> p(y)) <->
8315 ((EX x. q(x)) <-> (ALL y. p(y)))) <->
8316((EX x. ALL y. q(x) <-> q(y)) <->
8317 ((EX x. p(x)) <-> (ALL y. q(y))))
8318> val it = () : unit
8319Problem 35.
8320> val it = () : unit
8321EX x. EX y. P(x, y) --> (ALL u. ALL v. P(u, v))
8322 1. empty
8323    |-  EX x.
8324          EX y.
8325            P(x, y) --> (ALL u. ALL v. P(u, v))
8326> val it = () : unit
8327EX x. EX y. P(x, y) --> (ALL u. ALL v. P(u, v))
8328No subgoals left!
8329> val it = () : unit
8330EX x. EX y. P(x, y) --> (ALL u. ALL v. P(u, v))
8331> val it = () : unit
8332Problem 36.
8333> val it = () : unit
8334(ALL x. EX y. J(x, y)) &
8335((ALL x. EX y. G(x, y)) &
8336 (ALL x.
8337    ALL y.
8338      J(x, y) | G(x, y) -->
8339      (ALL z. J(y, z) | G(y, z) --> H(x, z)))) -->
8340(ALL x. EX y. H(x, y))
8341 1. empty
8342    |-  (ALL x. EX y. J(x, y)) &
8343        ((ALL x. EX y. G(x, y)) &
8344         (ALL x.
8345            ALL y.
8346              J(x, y) | G(x, y) -->
8347              (ALL z.
8348                 J(y, z) | G(y, z) -->
8349                 H(x, z)))) -->
8350        (ALL x. EX y. H(x, y))
8351> val it = () : unit
8352(ALL x. EX y. J(x, y)) &
8353((ALL x. EX y. G(x, y)) &
8354 (ALL x.
8355    ALL y.
8356      J(x, y) | G(x, y) -->
8357      (ALL z. J(y, z) | G(y, z) --> H(x, z)))) -->
8358(ALL x. EX y. H(x, y))
8359No subgoals left!
8360> val it = () : unit
8361(ALL x. EX y. J(x, y)) &
8362((ALL x. EX y. G(x, y)) &
8363 (ALL x.
8364    ALL y.
8365      J(x, y) | G(x, y) -->
8366      (ALL z. J(y, z) | G(y, z) --> H(x, z)))) -->
8367(ALL x. EX y. H(x, y))
8368> val it = () : unit
8369Problem 37
8370> val it = () : unit
8371(ALL z.
8372   EX w.
8373     ALL x.
8374       EX y.
8375         (P(x, z) --> P(y, w)) &
8376         (P(y, z) &
8377          (P(y, w) --> (EX u. Q(u, w))))) &
8378((ALL x. ALL z. ~P(x, z) --> (EX y. Q(y, z))) &
8379 ((EX x. EX y. Q(x, y)) --> (ALL x. R(x, x)))) -->
8380(ALL x. EX y. R(x, y))
8381 1. empty
8382    |-  (ALL z.
8383           EX w.
8384             ALL x.
8385               EX y.
8386                 (P(x, z) --> P(y, w)) &
8387                 (P(y, z) &
8388                  (P(y, w) -->
8389                   (EX u. Q(u, w))))) &
8390        ((ALL x.
8391            ALL z. ~P(x, z) --> (EX y. Q(y, z))) &
8392         ((EX x. EX y. Q(x, y)) -->
8393          (ALL x. R(x, x)))) -->
8394        (ALL x. EX y. R(x, y))
8395> val it = () : unit
8396(ALL z.
8397   EX w.
8398     ALL x.
8399       EX y.
8400         (P(x, z) --> P(y, w)) &
8401         (P(y, z) &
8402          (P(y, w) --> (EX u. Q(u, w))))) &
8403((ALL x. ALL z. ~P(x, z) --> (EX y. Q(y, z))) &
8404 ((EX x. EX y. Q(x, y)) --> (ALL x. R(x, x)))) -->
8405(ALL x. EX y. R(x, y))
8406No subgoals left!
8407> val it = () : unit
8408(ALL z.
8409   EX w.
8410     ALL x.
8411       EX y.
8412         (P(x, z) --> P(y, w)) &
8413         (P(y, z) &
8414          (P(y, w) --> (EX u. Q(u, w))))) &
8415((ALL x. ALL z. ~P(x, z) --> (EX y. Q(y, z))) &
8416 ((EX x. EX y. Q(x, y)) --> (ALL x. R(x, x)))) -->
8417(ALL x. EX y. R(x, y))
8418> val it = () : unit
8419Problem 38. NOT PROVED
8420> val it = () : unit
8421(ALL x.
8422   p(a) & (p(x) --> (EX y. p(y) & r(x, y))) -->
8423   (EX z. EX w. p(z) & (r(x, w) & r(w, z)))) <->
8424(ALL x.
8425   (~p(a) |
8426    (p(x) |
8427     (EX z. EX w. p(z) & (r(x, w) & r(w, z))))) &
8428   (~p(a) |
8429    (~(EX y. p(y) & r(x, y)) |
8430     (EX z. EX w. p(z) & (r(x, w) & r(w, z))))))
8431 1. empty
8432    |-  (ALL x.
8433           p(a) &
8434           (p(x) --> (EX y. p(y) & r(x, y))) -->
8435           (EX z.
8436              EX w.
8437                p(z) & (r(x, w) & r(w, z)))) <->
8438        (ALL x.
8439           (~p(a) |
8440            (p(x) |
8441             (EX z.
8442                EX w.
8443                  p(z) & (r(x, w) & r(w, z))))) &
8444           (~p(a) |
8445            (~(EX y. p(y) & r(x, y)) |
8446             (EX z.
8447                EX w.
8448                  p(z) & (r(x, w) & r(w, z))))))
8449> val it = () : unit
8450Problem 39
8451> val it = () : unit
8452~(EX x. ALL y. J(x, y) <-> ~J(y, y))
8453 1. empty
8454    |-  ~(EX x. ALL y. J(x, y) <-> ~J(y, y))
8455> val it = () : unit
8456~(EX x. ALL y. J(x, y) <-> ~J(y, y))
8457No subgoals left!
8458> val it = () : unit
8459~(EX x. ALL y. J(x, y) <-> ~J(y, y))
8460> val it = () : unit
8461Problem 40. AMENDED
8462> val it = () : unit
8463(EX y. ALL x. J(y, x) <-> ~J(x, x)) -->
8464~(ALL x. EX y. ALL z. J(z, y) <-> ~J(z, x))
8465 1. empty
8466    |-  (EX y. ALL x. J(y, x) <-> ~J(x, x)) -->
8467        ~(ALL x.
8468            EX y. ALL z. J(z, y) <-> ~J(z, x))
8469> val it = () : unit
8470(EX y. ALL x. J(y, x) <-> ~J(x, x)) -->
8471~(ALL x. EX y. ALL z. J(z, y) <-> ~J(z, x))
8472No subgoals left!
8473> val it = () : unit
8474(EX y. ALL x. J(y, x) <-> ~J(x, x)) -->
8475~(ALL x. EX y. ALL z. J(z, y) <-> ~J(z, x))
8476> val it = () : unit
8477Problem 41
8478> val it = () : unit
8479(ALL z.
8480   EX y.
8481     ALL x. f(x, y) <-> f(x, z) & ~f(x, x)) -->
8482~(EX z. ALL x. f(x, z))
8483 1. empty
8484    |-  (ALL z.
8485           EX y.
8486             ALL x.
8487               f(x, y) <-> f(x, z) & ~f(x, x)) -->
8488        ~(EX z. ALL x. f(x, z))
8489> val it = () : unit
8490(ALL z.
8491   EX y.
8492     ALL x. f(x, y) <-> f(x, z) & ~f(x, x)) -->
8493~(EX z. ALL x. f(x, z))
8494No subgoals left!
8495> val it = () : unit
8496(ALL z.
8497   EX y.
8498     ALL x. f(x, y) <-> f(x, z) & ~f(x, x)) -->
8499~(EX z. ALL x. f(x, z))
8500> val it = () : unit
8501Problem 42
8502> val it = () : unit
8503~(EX y.
8504    ALL x. p(x, y) <-> ~(EX z. p(x, z) & p(z, x)))
8505 1. empty
8506    |-  ~(EX y.
8507            ALL x.
8508              p(x, y) <->
8509              ~(EX z. p(x, z) & p(z, x)))
8510> val it = () : unit
8511~(EX y.
8512    ALL x. p(x, y) <-> ~(EX z. p(x, z) & p(z, x)))
8513No subgoals left!
8514> val it = () : unit
8515~(EX y.
8516    ALL x. p(x, y) <-> ~(EX z. p(x, z) & p(z, x)))
8517> val it = () : unit
8518Problem 43 NOT PROVED
8519> val it = () : unit
8520(ALL x.
8521   ALL y.
8522     q(x, y) <-> (ALL z. p(z, x) <-> p(z, y))) -->
8523(ALL x. ALL y. q(x, y) <-> q(y, x))
8524 1. empty
8525    |-  (ALL x.
8526           ALL y.
8527             q(x, y) <->
8528             (ALL z. p(z, x) <-> p(z, y))) -->
8529        (ALL x. ALL y. q(x, y) <-> q(y, x))
8530> val it = () : unit
8531Problem 44
8532> val it = () : unit
8533(ALL x.
8534   f(x) -->
8535   (EX y.
8536      g(y) &
8537      (h(x, y) & (EX y. g(y) & ~h(x, y))))) &
8538(EX x. j(x) & (ALL y. g(y) --> h(x, y))) -->
8539(EX x. j(x) & ~f(x))
8540 1. empty
8541    |-  (ALL x.
8542           f(x) -->
8543           (EX y.
8544              g(y) &
8545              (h(x, y) &
8546               (EX y. g(y) & ~h(x, y))))) &
8547        (EX x.
8548           j(x) & (ALL y. g(y) --> h(x, y))) -->
8549        (EX x. j(x) & ~f(x))
8550> val it = () : unit
8551(ALL x.
8552   f(x) -->
8553   (EX y.
8554      g(y) &
8555      (h(x, y) & (EX y. g(y) & ~h(x, y))))) &
8556(EX x. j(x) & (ALL y. g(y) --> h(x, y))) -->
8557(EX x. j(x) & ~f(x))
8558No subgoals left!
8559> val it = () : unit
8560(ALL x.
8561   f(x) -->
8562   (EX y.
8563      g(y) &
8564      (h(x, y) & (EX y. g(y) & ~h(x, y))))) &
8565(EX x. j(x) & (ALL y. g(y) --> h(x, y))) -->
8566(EX x. j(x) & ~f(x))
8567> val it = () : unit
8568Problem 45
8569> val it = () : unit
8570(ALL x.
8571   f(x) & (ALL y. g(y) & h(x, y) --> j(x, y)) -->
8572   (ALL y. g(y) & h(x, y) --> k(y))) &
8573(~(EX y. l(y) & k(y)) &
8574 (EX x.
8575    f(x) &
8576    ((ALL y. h(x, y) --> l(y)) &
8577     (ALL y. g(y) & h(x, y) --> j(x, y))))) -->
8578(EX x. f(x) & ~(EX y. g(y) & h(x, y)))
8579 1. empty
8580    |-  (ALL x.
8581           f(x) &
8582           (ALL y. g(y) & h(x, y) --> j(x, y)) -->
8583           (ALL y. g(y) & h(x, y) --> k(y))) &
8584        (~(EX y. l(y) & k(y)) &
8585         (EX x.
8586            f(x) &
8587            ((ALL y. h(x, y) --> l(y)) &
8588             (ALL y.
8589                g(y) & h(x, y) --> j(x, y))))) -->
8590        (EX x. f(x) & ~(EX y. g(y) & h(x, y)))
8591> val it = () : unit
8592(ALL x.
8593   f(x) & (ALL y. g(y) & h(x, y) --> j(x, y)) -->
8594   (ALL y. g(y) & h(x, y) --> k(y))) &
8595(~(EX y. l(y) & k(y)) &
8596 (EX x.
8597    f(x) &
8598    ((ALL y. h(x, y) --> l(y)) &
8599     (ALL y. g(y) & h(x, y) --> j(x, y))))) -->
8600(EX x. f(x) & ~(EX y. g(y) & h(x, y)))
8601No subgoals left!
8602> val it = () : unit
8603(ALL x.
8604   f(x) & (ALL y. g(y) & h(x, y) --> j(x, y)) -->
8605   (ALL y. g(y) & h(x, y) --> k(y))) &
8606(~(EX y. l(y) & k(y)) &
8607 (EX x.
8608    f(x) &
8609    ((ALL y. h(x, y) --> l(y)) &
8610     (ALL y. g(y) & h(x, y) --> j(x, y))))) -->
8611(EX x. f(x) & ~(EX y. g(y) & h(x, y)))
8612> val it = () : unit
8613Problem 46
8614> val it = () : unit
8615(ALL x.
8616   f(x) & (ALL y. f(y) & h(y, x) --> g(y)) -->
8617   g(x)) &
8618(((EX x. f(x) & ~g(x)) -->
8619  (EX x.
8620     f(x) &
8621     (~g(x) &
8622      (ALL y. f(y) & ~g(y) --> j(x, y))))) &
8623 (ALL x.
8624    ALL y.
8625      f(x) & (f(y) & h(x, y)) --> ~j(y, x))) -->
8626(ALL x. f(x) --> g(x))
8627 1. empty
8628    |-  (ALL x.
8629           f(x) &
8630           (ALL y. f(y) & h(y, x) --> g(y)) -->
8631           g(x)) &
8632        (((EX x. f(x) & ~g(x)) -->
8633          (EX x.
8634             f(x) &
8635             (~g(x) &
8636              (ALL y.
8637                 f(y) & ~g(y) --> j(x, y))))) &
8638         (ALL x.
8639            ALL y.
8640              f(x) & (f(y) & h(x, y)) -->
8641              ~j(y, x))) -->
8642        (ALL x. f(x) --> g(x))
8643> val it = () : unit
8644(ALL x.
8645   f(x) & (ALL y. f(y) & h(y, x) --> g(y)) -->
8646   g(x)) &
8647(((EX x. f(x) & ~g(x)) -->
8648  (EX x.
8649     f(x) &
8650     (~g(x) &
8651      (ALL y. f(y) & ~g(y) --> j(x, y))))) &
8652 (ALL x.
8653    ALL y.
8654      f(x) & (f(y) & h(x, y)) --> ~j(y, x))) -->
8655(ALL x. f(x) --> g(x))
8656No subgoals left!
8657> val it = () : unit
8658(ALL x.
8659   f(x) & (ALL y. f(y) & h(y, x) --> g(y)) -->
8660   g(x)) &
8661(((EX x. f(x) & ~g(x)) -->
8662  (EX x.
8663     f(x) &
8664     (~g(x) &
8665      (ALL y. f(y) & ~g(y) --> j(x, y))))) &
8666 (ALL x.
8667    ALL y.
8668      f(x) & (f(y) & h(x, y)) --> ~j(y, x))) -->
8669(ALL x. f(x) --> g(x))
8670> val it = () : unit
8671(ALL x.
8672   ALL y.
8673     ALL z. P(x, y) --> (P(y, z) --> P(x, z))) -->
8674((ALL x.
8675    ALL y.
8676      ALL z.
8677        Q(x, y) --> (Q(y, z) --> Q(x, z))) -->
8678 ((ALL x. ALL y. Q(x, y) --> Q(y, x)) -->
8679  ((ALL x. ALL y. P(x, y) | Q(x, y)) -->
8680   (ALL x. ALL y. P(x, y)) |
8681   (ALL x. ALL y. Q(x, y)))))
8682 1. empty
8683    |-  (ALL x.
8684           ALL y.
8685             ALL z.
8686               P(x, y) -->
8687               (P(y, z) --> P(x, z))) -->
8688        ((ALL x.
8689            ALL y.
8690              ALL z.
8691                Q(x, y) -->
8692                (Q(y, z) --> Q(x, z))) -->
8693         ((ALL x. ALL y. Q(x, y) --> Q(y, x)) -->
8694          ((ALL x. ALL y. P(x, y) | Q(x, y)) -->
8695           (ALL x. ALL y. P(x, y)) |
8696           (ALL x. ALL y. Q(x, y)))))
8697> val it = () : unit
8698Problem 47  Schubert's Steamroller
8699> val it = () : unit
8700(ALL x. P1(x) --> P0(x)) &
8701((EX x. P1(x)) &
8702 ((ALL x. P2(x) --> P0(x)) &
8703  ((EX x. P2(x)) &
8704   ((ALL x. P3(x) --> P0(x)) &
8705    ((EX x. P3(x)) &
8706     ((ALL x. P4(x) --> P0(x)) &
8707      ((EX x. P4(x)) &
8708       ((ALL x. P5(x) --> P0(x)) &
8709        ((EX x. P5(x)) &
8710         ((ALL x. Q1(x) --> Q0(x)) &
8711          ((EX x. Q1(x)) &
8712           ((ALL x.
8713               P0(x) -->
8714               (ALL y. Q0(y) --> R(x, y)) |
8715               (ALL y.
8716                  P0(y) &
8717                  (S(y, x) &
8718                   (EX z. Q0(z) & R(y, z))) -->
8719                  R(x, y))) &
8720            ((ALL x.
8721                ALL y.
8722                  P3(y) & (P5(x) | P4(x)) -->
8723                  S(x, y)) &
8724             ((ALL x.
8725                 ALL y.
8726                   P3(x) & P2(y) --> S(x, y)) &
8727              ((ALL x.
8728                  ALL y.
8729                    P2(x) & P1(y) --> S(x, y)) &
8730               ((ALL x.
8731                   ALL y.
8732                     P1(x) & (P2(y) | Q1(y)) -->
8733                     ~R(x, y)) &
8734                ((ALL x.
8735                    ALL y.
8736                      P3(x) & P4(y) --> R(x, y)) &
8737                 ((ALL x.
8738                     ALL y.
8739                       P3(x) & P5(y) -->
8740                       ~R(x, y)) &
8741                  (ALL x.
8742                     P4(x) | P5(x) -->
8743                     (EX y.
8744                        Q0(y) &
8745                        R(x,
8746                          y))))))))))))))))))))) -->
8747(EX x.
8748   EX y.
8749     P0(x) &
8750     (P0(y) &
8751      (EX z. Q1(z) & (R(y, z) & R(x, y)))))
8752 1. empty
8753    |-  (ALL x. P1(x) --> P0(x)) &
8754        ((EX x. P1(x)) &
8755         ((ALL x. P2(x) --> P0(x)) &
8756          ((EX x. P2(x)) &
8757           ((ALL x. P3(x) --> P0(x)) &
8758            ((EX x. P3(x)) &
8759             ((ALL x. P4(x) --> P0(x)) &
8760              ((EX x. P4(x)) &
8761               ((ALL x. P5(x) --> P0(x)) &
8762                ((EX x. P5(x)) &
8763                 ((ALL x. Q1(x) --> Q0(x)) &
8764                  ((EX x. Q1(x)) &
8765                   ((ALL x.
8766                       P0(x) -->
8767                       (ALL y.
8768                          Q0(y) --> R(x, y)) |
8769                       (ALL y.
8770                          P0(y) &
8771                          (S(y, x) &
8772                           (EX z.
8773                              Q0(z) &
8774                              R(y, z))) -->
8775                          R(x, y))) &
8776                    ((ALL x.
8777                        ALL y.
8778                          P3(y) &
8779                          (P5(x) | P4(x)) -->
8780                          S(x, y)) &
8781                     ((ALL x.
8782                         ALL y.
8783                           P3(x) & P2(y) -->
8784                           S(x, y)) &
8785                      ((ALL x.
8786                          ALL y.
8787                            P2(x) & P1(y) -->
8788                            S(x, y)) &
8789                       ((ALL x.
8790                           ALL y.
8791                             P1(x) &
8792                             (P2(y) | Q1(y)) -->
8793                             ~R(x, y)) &
8794                        ((ALL x.
8795                            ALL y.
8796                              P3(x) & P4(y) -->
8797                              R(x, y)) &
8798                         ((ALL x.
8799                             ALL y.
8800                               P3(x) & P5(y) -->
8801                               ~R(x, y)) &
8802                          (ALL x.
8803                             P4(x) | P5(x) -->
8804                             (EX y.
8805                                Q0(y) &
8806                                R(x,
8807                                  y))))))))))))))))))))) -->
8808        (EX x.
8809           EX y.
8810             P0(x) &
8811             (P0(y) &
8812              (EX z.
8813                 Q1(z) & (R(y, z) & R(x, y)))))
8814> val it = () : unit
8815Reached end of file.
8816> val it = () : unit
8817[closing file "test10.sml"]
8818> val it = () : unit
8819Moscow ML version 2.01a (January 2004)
8820Enter `quit();' to quit.
8821- > signature S = /\t.{type t = t, val x : t, val f : t -> unit}
8822- ! Toplevel input:
8823! functor Apply F:ARG = F(Unit)
8824!                 ^^^
8825! Illegal applicative functor argument: the signature specifies a generative functor in a positive position
8826-
8827Moscow ML version 2.01a (January 2004)
8828Enter `quit();' to quit.
8829- ! Toplevel input:
8830! functor WrongApp X:sig end = struct structure X as sig type t end = [structure struct  type t = int end as sig type t end] end;
8831!                                               ^
8832! Illegal structure binding: a structure value cannot be opened in a functor body
8833- ! Toplevel input:
8834! functor WrongGen (A : sig end) = struct structure X as sig type t end = [structure struct  type t = int end as sig type t end] end;
8835!                                                   ^
8836! Illegal structure binding: a structure value cannot be opened in a functor body
8837-
8838Moscow ML version 2.01a (January 2004)
8839Enter `quit();' to quit.
8840- > signature S = {val 'a x : ('a -> 'a) ref}
8841- ! Toplevel input:
8842! structure S :> S = struct fun id x = x; val x = ref id end;
8843!             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8844! Signature mismatch: the module does not match the signature ...
8845! Scheme mismatch: value identifier x
8846! is specified with type scheme
8847!   val 'a' x : ('a' -> 'a') ref
8848! in the signature
8849! but its declaration has the unrelated type scheme
8850!   val x : ('a -> 'a) ref
8851! in the module
8852! The declared type scheme should be at least as general as the specified type scheme
8853- ! Toplevel input:
8854! val _ = S.x := (fn _ => 0);
8855!         ^^^
8856! Cannot access unit S before it has been loaded.
8857-
8858