88 val mk_not : compilation_funs -> term -> term |
88 val mk_not : compilation_funs -> term -> term |
89 val mk_map : compilation_funs -> typ -> typ -> term -> term -> term |
89 val mk_map : compilation_funs -> typ -> typ -> term -> term -> term |
90 val funT_of : compilation_funs -> mode -> typ -> typ |
90 val funT_of : compilation_funs -> mode -> typ -> typ |
91 (* Different compilations *) |
91 (* Different compilations *) |
92 datatype compilation = Pred | Depth_Limited | Random | Depth_Limited_Random | DSeq | Annotated |
92 datatype compilation = Pred | Depth_Limited | Random | Depth_Limited_Random | DSeq | Annotated |
93 | Pos_Random_DSeq | Neg_Random_DSeq | New_Pos_Random_DSeq | New_Neg_Random_DSeq |
93 | Pos_Random_DSeq | Neg_Random_DSeq | New_Pos_Random_DSeq | New_Neg_Random_DSeq |
94 | Pos_Generator_DSeq | Neg_Generator_DSeq |
94 | Pos_Generator_DSeq | Neg_Generator_DSeq | Pos_Generator_CPS | Neg_Generator_CPS |
95 val negative_compilation_of : compilation -> compilation |
95 val negative_compilation_of : compilation -> compilation |
96 val compilation_for_polarity : bool -> compilation -> compilation |
96 val compilation_for_polarity : bool -> compilation -> compilation |
97 val is_depth_limited_compilation : compilation -> bool |
97 val is_depth_limited_compilation : compilation -> bool |
98 val string_of_compilation : compilation -> string |
98 val string_of_compilation : compilation -> string |
99 val compilation_names : (string * compilation) list |
99 val compilation_names : (string * compilation) list |
640 |
640 |
641 (* Different compilations *) |
641 (* Different compilations *) |
642 |
642 |
643 datatype compilation = Pred | Depth_Limited | Random | Depth_Limited_Random | DSeq | Annotated |
643 datatype compilation = Pred | Depth_Limited | Random | Depth_Limited_Random | DSeq | Annotated |
644 | Pos_Random_DSeq | Neg_Random_DSeq | New_Pos_Random_DSeq | New_Neg_Random_DSeq | |
644 | Pos_Random_DSeq | Neg_Random_DSeq | New_Pos_Random_DSeq | New_Neg_Random_DSeq | |
645 Pos_Generator_DSeq | Neg_Generator_DSeq |
645 Pos_Generator_DSeq | Neg_Generator_DSeq | Pos_Generator_CPS | Neg_Generator_CPS |
646 |
646 |
647 fun negative_compilation_of Pos_Random_DSeq = Neg_Random_DSeq |
647 fun negative_compilation_of Pos_Random_DSeq = Neg_Random_DSeq |
648 | negative_compilation_of Neg_Random_DSeq = Pos_Random_DSeq |
648 | negative_compilation_of Neg_Random_DSeq = Pos_Random_DSeq |
649 | negative_compilation_of New_Pos_Random_DSeq = New_Neg_Random_DSeq |
649 | negative_compilation_of New_Pos_Random_DSeq = New_Neg_Random_DSeq |
650 | negative_compilation_of New_Neg_Random_DSeq = New_Pos_Random_DSeq |
650 | negative_compilation_of New_Neg_Random_DSeq = New_Pos_Random_DSeq |
651 | negative_compilation_of Pos_Generator_DSeq = Neg_Generator_DSeq |
651 | negative_compilation_of Pos_Generator_DSeq = Neg_Generator_DSeq |
652 | negative_compilation_of Pos_Generator_DSeq = Pos_Generator_DSeq |
652 | negative_compilation_of Neg_Generator_DSeq = Pos_Generator_DSeq |
|
653 | negative_compilation_of Pos_Generator_CPS = Neg_Generator_CPS |
|
654 | negative_compilation_of Neg_Generator_CPS = Pos_Generator_CPS |
653 | negative_compilation_of c = c |
655 | negative_compilation_of c = c |
654 |
656 |
655 fun compilation_for_polarity false Pos_Random_DSeq = Neg_Random_DSeq |
657 fun compilation_for_polarity false Pos_Random_DSeq = Neg_Random_DSeq |
656 | compilation_for_polarity false New_Pos_Random_DSeq = New_Neg_Random_DSeq |
658 | compilation_for_polarity false New_Pos_Random_DSeq = New_Neg_Random_DSeq |
657 | compilation_for_polarity _ c = c |
659 | compilation_for_polarity _ c = c |
672 | Neg_Random_DSeq => "neg_random_dseq" |
674 | Neg_Random_DSeq => "neg_random_dseq" |
673 | New_Pos_Random_DSeq => "new_pos_random dseq" |
675 | New_Pos_Random_DSeq => "new_pos_random dseq" |
674 | New_Neg_Random_DSeq => "new_neg_random_dseq" |
676 | New_Neg_Random_DSeq => "new_neg_random_dseq" |
675 | Pos_Generator_DSeq => "pos_generator_dseq" |
677 | Pos_Generator_DSeq => "pos_generator_dseq" |
676 | Neg_Generator_DSeq => "neg_generator_dseq" |
678 | Neg_Generator_DSeq => "neg_generator_dseq" |
677 |
679 | Pos_Generator_CPS => "pos_generator_cps" |
|
680 | Neg_Generator_CPS => "neg_generator_cps" |
|
681 |
678 val compilation_names = [("pred", Pred), |
682 val compilation_names = [("pred", Pred), |
679 ("random", Random), |
683 ("random", Random), |
680 ("depth_limited", Depth_Limited), |
684 ("depth_limited", Depth_Limited), |
681 ("depth_limited_random", Depth_Limited_Random), |
685 ("depth_limited_random", Depth_Limited_Random), |
682 (*("annotated", Annotated),*) |
686 (*("annotated", Annotated),*) |
683 ("dseq", DSeq), |
687 ("dseq", DSeq), |
684 ("random_dseq", Pos_Random_DSeq), |
688 ("random_dseq", Pos_Random_DSeq), |
685 ("new_random_dseq", New_Pos_Random_DSeq), |
689 ("new_random_dseq", New_Pos_Random_DSeq), |
686 ("generator_dseq", Pos_Generator_DSeq)] |
690 ("generator_dseq", Pos_Generator_DSeq), |
|
691 ("generator_cps", Pos_Generator_CPS)] |
687 |
692 |
688 val non_random_compilations = [Pred, Depth_Limited, DSeq, Annotated] |
693 val non_random_compilations = [Pred, Depth_Limited, DSeq, Annotated] |
689 |
694 |
690 |
695 |
691 val random_compilations = [Random, Depth_Limited_Random, |
696 val random_compilations = [Random, Depth_Limited_Random, |
692 Pos_Random_DSeq, Neg_Random_DSeq, New_Pos_Random_DSeq, New_Neg_Random_DSeq] |
697 Pos_Random_DSeq, Neg_Random_DSeq, New_Pos_Random_DSeq, New_Neg_Random_DSeq, Pos_Generator_CPS] |
693 |
698 |
694 (* datastructures and setup for generic compilation *) |
699 (* datastructures and setup for generic compilation *) |
695 |
700 |
696 datatype compilation_funs = CompilationFuns of { |
701 datatype compilation_funs = CompilationFuns of { |
697 mk_predT : typ -> typ, |
702 mk_predT : typ -> typ, |