@@ -639,6 +639,77 @@ codet java_string_library_preprocesst::code_return_function_application(
639
639
return code_returnt (fun_app);
640
640
}
641
641
642
+ exprt make_nondet_infinite_char_array (
643
+ symbol_tablet &symbol_table,
644
+ const source_locationt &loc,
645
+ code_blockt &code)
646
+ {
647
+ const array_typet array_type (
648
+ java_char_type (), infinity_exprt (java_int_type ()));
649
+ const symbolt data_sym = get_fresh_aux_symbol (
650
+ array_type,
651
+ " nondet_inifinite_array" ,
652
+ " nondet_inifinite_array" ,
653
+ loc,
654
+ ID_java,
655
+ symbol_table);
656
+ const symbol_exprt data_expr = data_sym.symbol_expr ();
657
+ code.add (code_declt (data_expr));
658
+ side_effect_expr_nondett nondet_data (data_expr.type ());
659
+ code.add (code_assignt (data_expr, nondet_data));
660
+ return data_expr;
661
+ }
662
+
663
+ void add_pointer_to_array_association (
664
+ const exprt &pointer,
665
+ const exprt &array,
666
+ symbol_tablet &symbol_table,
667
+ const source_locationt &loc,
668
+ code_blockt &code)
669
+ {
670
+ PRECONDITION (array.type ().id () == ID_array);
671
+ PRECONDITION (pointer.type ().id () == ID_pointer);
672
+ symbolt &return_sym = get_fresh_aux_symbol (
673
+ java_int_type (),
674
+ " return_array" ,
675
+ " return_array" ,
676
+ loc,
677
+ ID_java,
678
+ symbol_table);
679
+ exprt return_expr = return_sym.symbol_expr ();
680
+ code.add (code_declt (return_expr));
681
+ code.add (
682
+ code_assign_function_application (
683
+ return_expr,
684
+ ID_cprover_associate_array_to_pointer_func,
685
+ {array, pointer},
686
+ symbol_table));
687
+ }
688
+
689
+ void add_array_to_length_association (
690
+ const exprt &array,
691
+ const exprt &length,
692
+ symbol_tablet &symbol_table,
693
+ const source_locationt &loc,
694
+ code_blockt &code)
695
+ {
696
+ symbolt &return_sym = get_fresh_aux_symbol (
697
+ java_int_type (),
698
+ " return_array" ,
699
+ " return_array" ,
700
+ loc,
701
+ ID_java,
702
+ symbol_table);
703
+ const exprt return_expr = return_sym.symbol_expr ();
704
+ code.add (code_declt (return_expr));
705
+ code.add (
706
+ code_assign_function_application (
707
+ return_expr,
708
+ ID_cprover_associate_length_to_array_func,
709
+ {array, length},
710
+ symbol_table));
711
+ }
712
+
642
713
// / \param string_expr: a string expression
643
714
// / \param function_name: the name of the function
644
715
// / \param arguments: arguments of the function
0 commit comments