@@ -24,23 +24,25 @@ private static SampleParameters sample(int[] values, int begin, int end, Storage
2424 /*@ assert sample0: \dl_seqPerm(\dl_seq_def_workaround(begin, end, values), \old(\dl_seq_def_workaround(begin, end, values))) \by {
2525 oss;
2626 assert "seqDef{int j;}(begin, end, any::select(heap, values, arr(j))) = seqDef{int j;}(begin, end, any::select(heapAfter_SampleParameters, values, arr(j)))" \by {
27- auto ;
27+ tryclose branch steps=4000 ;
2828 }
29- auto ;
29+ tryclose branch steps=4000 ;
3030 }
3131 @*/
3232
3333 Functions .select_n (values , begin , end , parameters .num_samples );
3434 /*@ assert sample1: \dl_seqPerm(\dl_seq_def_workaround(begin, end, values), \old(\dl_seq_def_workaround(begin, end, values))) \by {
35- auto ;
35+ tryclose branch steps=4000 ;
3636 };
3737 @*/
3838
3939 //@ ghost \seq before_sort = \dl_seq_def_workaround(begin, end, values);
4040 sort (values , begin , begin + parameters .num_samples , storage );
4141 /*@ assert sample2: \dl_seqPerm(\dl_seq_def_workaround(begin, end, values), before_sort) \by {
4242 oss;
43- assert "wellFormed(heapAfter_sort)" \by { auto; } // this is missing in the original proof by JW, but somehow needed here (automode does not find it)
43+ assert "wellFormed(heapAfter_sort)" \by {
44+ tryclose branch steps=4000;
45+ } // this is missing in the original proof by JW, but somehow needed here (automode does not find it)
4446
4547 // TODO: not very robust: "self" is frequently renamed (e.g. to self_25)
4648 let @numSamplesFinal="int::final(self, de.wiesler.SampleParameters::$num_samples)";
@@ -49,15 +51,15 @@ private static SampleParameters sample(int[] values, int begin, int end, Storage
4951 seqDef{int j;}(add(begin, @numSamplesFinal), end, any::select(heapAfter_select_n, values, arr(j))))" \by {
5052 assert "seqDef{int j;}(begin + @numSamplesFinal, end, any::select(heapAfter_select_n, values, arr(j)))
5153 = seqDef{int j;}(begin + @numSamplesFinal, end, values[j]@heapAfter_sort)" \by {
52- auto ;
54+ tryclose branch steps=4000 ;
5355 }
54- auto ;
56+ tryclose branch steps=4000 ;
5557 }
5658
5759 //rule seqPermConcatFW on="seqPerm(seqDef{int j;}(begin, add(int::_, int::_)), seqDef{int j;}(begin, add(int::_, int::_)))"; // not needed
5860 rule seqDef_split on="seqDef{int j;}(begin, end, any::select(heapAfter_sort, values, arr(j)))" inst_idx="begin+@numSamplesFinal";
5961 rule seqDef_split on="seqDef{int j;}(begin, end, any::select(heapAfter_select_n, values, arr(j)))" inst_idx="begin+@numSamplesFinal" occ=2;
60- auto ;
62+ tryclose branch steps=4000 ;
6163 }
6264 @*/
6365
@@ -460,10 +462,6 @@ private static void sample_sort_recurse_on(int[] values, int begin, int end, Sto
460462 rule seqDef_split on="seqDef{int uSub1;}(@middle, end, any::select(heap, values, arr(uSub1)))" inst_idx="@middleSucc";
461463 rule seqDef_split on="seqDef{int uSub1;}(@middle, end, any::select(anon(Heap::_, LocSet::_, Heap::_), values, arr(uSub1)))" inst_idx="@middleSucc";
462464
463- // TODO: same problem as always: does not work
464- //auto steps=1000 dependencies=false classAxioms=false modelSearch=false expandQueries=false;
465- //leave;
466-
467465 // workaround: this also affects all branches visited afterwards!
468466 set key="CLASS_AXIOM_OPTIONS_KEY" value="CLASS_AXIOM_OFF";
469467 set key="DEP_OPTIONS_KEY" value="DEP_OFF";
@@ -734,8 +732,7 @@ private static void sample_sort(int[] values, int begin, int end, Storage storag
734732 }
735733 }
736734
737- /*@ assert sortednessFromPartitionSorted(values, begin, end, bucket_starts, num_buckets);
738- @*/
735+ //@ assert sortednessFromPartitionSorted(values, begin, end, bucket_starts, num_buckets);
739736 }
740737
741738 /*@ public normal_behaviour
@@ -757,10 +754,6 @@ public static void fallback_sort(int[] values, int begin, int end) {
757754 oss;
758755 rule allRight;
759756
760- // of these two, always only the first one works for some reason:
761- //expand on="de.wiesler.Functions.countElement(values, begin, end, element_0)";
762- //expand on="de.wiesler.Functions.countElement(values, begin, end, element_0)@heapAfter_insertion_sort";
763-
764757 expand on="de.wiesler.Functions::countElement(heap, values, begin, end, element_0)";
765758 expand on="de.wiesler.Functions::countElement(heapAfter_insertion_sort, values, begin, end, element_0)";
766759 rule seqPermCountsInt;
@@ -776,15 +769,13 @@ public static void fallback_sort(int[] values, int begin, int end) {
776769 assert "bsum{int uSub1;}(0, end - begin, \if (values[uSub1 + begin] = element_0) \then (1) \else (0))
777770 = bsum{int iv;}(0, end - begin, \if (seqDef{int j;}(begin, end, values[j])[iv] = element_0) \then (1) \else (0))";
778771
779- // None of those is able close the goal for some reason. In the GUI, it works fine.
780- // auto;
781- // Not sure if the parameters actually affect anything ...
782- //auto classAxioms=true expandQueries=true modelSearch=true dependencies=true proofSplitting=true steps=2000;
783-
784- // workaround (more detailed params not supported at the moment)
772+ // workaround: this also affects all branches visited afterwards!
773+ set key="CLASS_AXIOM_OPTIONS_KEY" value="CLASS_AXIOM_DELAYED";
774+ set key="DEP_OPTIONS_KEY" value="DEP_ON";
775+ set key="NON_LIN_ARITH_OPTIONS_KEY" value="NON_LIN_ARITH_DEF_OPS";
776+ set key="QUERYAXIOM_OPTIONS_KEY" value="QUERYAXIOM_OFF";
785777 tryclose branch steps=2000;
786- };
787- @*/
778+ }; */
788779 }
789780
790781 /*@ model_behaviour
@@ -838,7 +829,7 @@ public static void insertion_sort(int[] values, int begin, int end) {
838829 auto steps=7000 classAxioms=true dependency=false modelSearch=false expandQueries=false;
839830 }
840831 auto steps=200 add_applyEqReverse=high classAxioms=false dependency=false modelSearch=false expandQueries=false;
841- } @ */
832+ } */
842833
843834 /*@ loop_invariant hole == i + 1;
844835 @ loop_invariant begin-1 <= i < k;
@@ -858,7 +849,7 @@ public static void insertion_sort(int[] values, int begin, int end) {
858849 // TODO: there seems to be a bug in interplay of loop scopes and script ("program variable h not known") -> make sure to use loop transformation rule here!
859850 /*@ assert insSort1: \dl_seqPerm(seqUpd(\dl_seq_def_workaround(begin, end, values), hole - begin, value), \old(\dl_seq_def_workaround(begin, end, values))) \by {
860851 leave;
861- } @ */
852+ } */
862853 /* @ assert insSort1: \dl_seqPerm(seqUpd(\dl_seq_def_workaround(begin, end, values), hole - begin, value), \old(\dl_seq_def_workaround(begin, end, values))) \by {
863854
864855 oss;
@@ -890,8 +881,8 @@ public static void insertion_sort(int[] values, int begin, int end) {
890881 set key="DEP_OPTIONS_KEY" value="DEP_OFF";
891882 set key="NON_LIN_ARITH_OPTIONS_KEY" value="NON_LIN_ARITH_DEF_OPS";
892883 set key="QUERYAXIOM_OPTIONS_KEY" value="QUERYAXIOM_OFF";
893- tryclose;
894- } @ */
884+ tryclose branch ;
885+ } */
895886 }
896887
897888 // @ ghost \dl_seq tmp = \dl_seq_def_workaround(begin, end, values);
@@ -902,14 +893,14 @@ public static void insertion_sort(int[] values, int begin, int end) {
902893 /* @ assert insSort2: \dl_seqPerm(\dl_seq_def_workaround(begin, end, values), \old(\dl_seq_def_workaround(begin, end, values))) \by {
903894 assert \dl_seq_def_workaround(begin, end, values) = seqUpd(tmp, begin * -1 + hole, values[k]);
904895 auto;
905- } @ */
896+ } */
906897 }
907898
908899 /* @ assert insSort3: true \by {
909900
910901 // the last branch still needs quite heavy automation ...
911902 auto steps=11000 dependency=false classAxioms=false expandQueries=false modelSearch=false;
912- } @ */
903+ } */
913904 }
914905
915906 /*@ public normal_behaviour
@@ -961,21 +952,21 @@ public static void sort(int[] values) {
961952 /*@ assert sort0: \disjoint(storage.allArrays, values[*]) \by {
962953 oss;
963954 rule disjointToElementOf;
964- auto ;
965- }; @ */
955+ tryclose branch steps=2000 ;
956+ }; */
966957 sort (values , 0 , values .length , storage );
967958 /*@ assert sort1: \dl_seqPerm(\dl_array2seq(values), \old(\dl_array2seq(values))) \by {
968959 oss;
969960 assert "seqDef{int u;}(0, values.length, any::select(heap, values, arr(u))) = seqDef{int j;}(0, values.length, any::select(heapAfter_Storage, values, arr(j)))" \by {
970- auto ;
961+ tryclose branch steps=2000 ;
971962 }
972- auto ;
973- } @ */
963+ tryclose branch steps=2000 ;
964+ } */
974965 /*@ assert sort2: \dl_assignable(\old(\dl_heap()), values[*]) \by {
975966 oss;
976967 rule assignableDefinition;
977968 macro "simp-heap";
978- auto ;
979- } @ */
969+ tryclose branch steps=2000 ;
970+ } */
980971 }
981972}
0 commit comments