2 /*+-----------------------------------------------------------------**
4 **-----------------------------------------------------------------**
6 **-----------------------------------------------------------------**
7 ** First version: 30/04/2008 **
8 **-----------------------------------------------------------------**
11 *****************************************************************************
12 * OpenScop: Structures and formats for polyhedral tools to talk together *
13 *****************************************************************************
14 * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, *
15 * / / / // // // // / / / // // / / // / /|,_, *
16 * / / / // // // // / / / // // / / // / / / /\ *
17 * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ *
18 * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ *
19 * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ *
20 * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ *
21 * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ *
22 * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ *
23 * | I | | | | e | | | | | | | | | | | | | \ \ \ *
24 * | T | | | | | | | | | | | | | | | | | \ \ \ *
25 * | E | | | | | | | | | | | | | | | | | \ \ \ *
26 * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ *
27 * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / *
28 * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' *
30 * Copyright (C) 2008 University Paris-Sud 11 and INRIA *
32 * (3-clause BSD license) *
33 * Redistribution and use in source and binary forms, with or without *
34 * modification, are permitted provided that the following conditions *
37 * 1. Redistributions of source code must retain the above copyright notice, *
38 * this list of conditions and the following disclaimer. *
39 * 2. Redistributions in binary form must reproduce the above copyright *
40 * notice, this list of conditions and the following disclaimer in the *
41 * documentation and/or other materials provided with the distribution. *
42 * 3. The name of the author may not be used to endorse or promote products *
43 * derived from this software without specific prior written permission. *
45 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
46 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *
47 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. *
48 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *
49 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT *
50 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
51 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
52 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
53 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *
54 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
56 * OpenScop Library, a library to manipulate OpenScop formats and data *
57 * structures. Written by: *
58 * Cedric Bastoul <Cedric.Bastoul@u-psud.fr> and *
59 * Louis-Noel Pouchet <Louis-Noel.pouchet@inria.fr> *
61 *****************************************************************************/
67 # include <openscop/scop.h>
70 /*+***************************************************************************
71 * Structure display functions *
72 *****************************************************************************/
76 * openscop_scop_print_structure function:
77 * this function displays an openscop_scop_t structure (*scop) into a
78 * file (file, possibly stdout) in a way that trends to be understandable. It
79 * includes an indentation level (level) in order to work with others
80 * print_structure functions.
81 * \param file The file where the information has to be printed.
82 * \param scop The scop structure whose information has to be printed.
83 * \param level Number of spaces before printing, for each line.
86 openscop_scop_print_structure(FILE * file
, openscop_scop_p scop
, int level
)
90 // Go to the right level.
91 for (j
= 0; j
< level
; j
++)
96 fprintf(file
, "+-- openscop_scop_t\n");
99 for (j
= 0; j
<= level
+1; j
++)
100 fprintf(file
, "|\t");
103 // Print the language.
104 for (j
= 0; j
< level
; j
++)
105 fprintf(file
, "|\t");
106 fprintf(file
, "|\tLanguage: %s\n", scop
->language
);
109 for (j
= 0; j
<= level
+1; j
++)
110 fprintf(file
, "|\t");
113 // Print the context of the scop.
114 openscop_relation_print_structure(file
, scop
->context
, level
+1);
117 openscop_names_print_structure(file
, scop
->names
, level
+1);
119 // Print the statements.
120 openscop_statement_print_structure(file
, scop
->statement
, level
+1);
122 // Print the extensions.
123 openscop_extension_print_structure(file
, scop
->extension
, level
+1);
126 for (j
= 0; j
<= level
+1; j
++)
127 fprintf(file
, "|\t");
132 fprintf(file
, "+-- NULL scop\n");
136 for (j
= 0; j
<= level
; j
++)
137 fprintf(file
, "|\t");
143 * openscop_scop_print function:
144 * this function prints the content of an openscop_scop_t structure (*scop)
145 * into a file (file, possibly stdout).
146 * \param file The file where the information has to be printed.
147 * \param scop The scop structure whose information has to be printed.
150 openscop_scop_print(FILE * file
, openscop_scop_p scop
)
152 openscop_scop_print_structure(file
, scop
, 0);
157 * openscop_scop_name_limits function:
158 * this function finds the (maximum) number of various elements of a scop and
159 * return the values through parameters. To ensure the correctness of the
160 * results, an integrity check of the input scop should be run before calling
162 * \param scop The scop to analyse.
163 * \parem nb_parameters The number of parameters in the scop (output).
164 * \parem nb_iterators The number of iterators in the scop (output).
165 * \parem nb_scattdims The number of scattdims in the scop (output).
166 * \parem nb_localdims The number of local dimensions in the scop (output).
167 * \parem nb_arrays The number of arrays in the scop (output).
171 openscop_scop_name_limits(openscop_scop_p scop
,
178 int i
, k
, tmp
, coef
, id
;
179 openscop_statement_p statement
;
180 openscop_relation_list_p list
;
182 // * The number of parameters is collected from the context,
183 // - in matrix format we compute it from the context using #columns,
184 // - in relation format it corresponds to the #parameters field.
185 // * The numbers of local dimensions are collected from all relations
186 // in the corresponding field, it is 0 for matrix format.
189 if (scop
->context
!= NULL
)
191 if (openscop_relation_is_matrix(scop
->context
))
193 *nb_parameters
= scop
->context
->nb_columns
- 2;
197 *nb_parameters
= scop
->context
->nb_parameters
;
198 *nb_localdims
= scop
->context
->nb_local_dims
;
205 statement
= scop
->statement
;
206 while (statement
!= NULL
)
208 // * The number of iterators are defined by iteration domains,
209 // - in matrix format we compute it using #columns and #parameters,
210 // - in relation format it corresponds to the #output_dims.
211 if (statement
->domain
!= NULL
)
213 if (openscop_relation_is_matrix(statement
->domain
))
215 tmp
= statement
->domain
->nb_columns
- *nb_parameters
- 2;
216 if (tmp
> *nb_iterators
)
221 if (statement
->domain
->nb_output_dims
> *nb_iterators
)
222 *nb_iterators
= statement
->domain
->nb_output_dims
;
224 if (statement
->domain
->nb_local_dims
> *nb_localdims
)
225 *nb_localdims
= statement
->domain
->nb_local_dims
;
229 // * The number of scattdims are defined by scattering,
230 // - in matrix format it corresponds to the number of rows,
231 // - in relation format it corresponds to the #input_dims.
232 if (statement
->scattering
!= NULL
)
234 if (openscop_relation_is_matrix(statement
->scattering
))
236 if (statement
->domain
->nb_rows
> *nb_scattdims
)
237 *nb_scattdims
= statement
->scattering
->nb_rows
;
241 if (statement
->scattering
->nb_input_dims
> *nb_scattdims
)
242 *nb_scattdims
= statement
->scattering
->nb_input_dims
;
244 if (statement
->scattering
->nb_local_dims
> *nb_localdims
)
245 *nb_localdims
= statement
->scattering
->nb_local_dims
;
249 // * The number of arrays are defined by accesses,
250 // - in matrix format, array identifiers are m[0][0],
251 // - in relation format, array identifiers are
252 // m[i][#columns -1] / m[i][1], with i the (supposedly only) row
253 // where m[i][1] is not 0.
254 for (k
= 0; k
< 2; k
++)
257 list
= statement
->read
;
259 list
= statement
->write
;
263 if (list
->elt
!= NULL
)
265 if (openscop_relation_is_matrix(list
->elt
))
267 if (SCOPINT_get_si(list
->elt
->m
[0][0]) > *nb_arrays
)
268 *nb_arrays
= SCOPINT_get_si(list
->elt
->m
[0][0]);
272 for (i
= 0; i
< list
->elt
->nb_rows
; i
++)
274 coef
= SCOPINT_get_si(list
->elt
->m
[i
][1]);
277 id
= SCOPINT_get_si(list
->elt
->m
[0][list
->elt
->nb_columns
-1]);
278 if (abs(id
/ coef
) > *nb_arrays
)
279 *nb_arrays
= abs(id
/ coef
);
283 if (statement
->scattering
->nb_local_dims
> *nb_localdims
)
284 *nb_localdims
= statement
->scattering
->nb_local_dims
;
292 statement
= statement
->next
;
298 * openscop_scop_full_names function:
299 * this function generates an openscop_names_p structure which contains
300 * enough names for the scop provided as parameter, for each kind of names.
301 * If the names contained in the input scop are not sufficient, this function
302 * generated the missing names.
303 * \param scop The scop we need a name for each element.
304 * \return A set of names for the scop.
308 openscop_scop_full_names(openscop_scop_p scop
)
315 openscop_arrays_p arrays
;
316 openscop_names_p names
;
318 names
= openscop_names_copy(scop
->names
);
320 // Extract array names information from extensions.
321 openscop_util_strings_free(names
->arrays
, names
->nb_arrays
);
322 arrays
= (openscop_arrays_p
)openscop_extension_lookup(scop
->extension
,
323 OPENSCOP_EXTENSION_ARRAYS
);
324 names
->arrays
= openscop_arrays_generate_names(arrays
,
325 &(names
->nb_arrays
));
327 // Complete names if necessary.
328 openscop_scop_name_limits(scop
, &nb_parameters
,
334 openscop_util_strings_complete(&names
->parameters
, &names
->nb_parameters
,
335 "P_", nb_parameters
);
337 openscop_util_strings_complete(&names
->iterators
, &names
->nb_iterators
,
340 openscop_util_strings_complete(&names
->scattdims
, &names
->nb_scattdims
,
343 openscop_util_strings_complete(&names
->localdims
, &names
->nb_localdims
,
346 openscop_util_strings_complete(&names
->arrays
, &names
->nb_arrays
,
354 * openscop_scop_print_openscop function:
355 * this function prints the content of an openscop_scop_t structure (*scop)
356 * into a file (file, possibly stdout) in the OpenScop textual format.
357 * \param file The file where the information has to be printed.
358 * \param scop The scop structure whose information has to be printed.
361 openscop_scop_print_openscop(FILE * file
, openscop_scop_p scop
)
363 openscop_names_p names
;
365 if (openscop_scop_integrity_check(scop
) == 0)
367 fprintf(stderr
, "[OpenScop] Error: OpenScop integrity check failed.\n");
371 // Build a name structure for pretty printing of relations.
372 names
= openscop_scop_full_names(scop
);
376 fprintf(file
, "# \n");
377 fprintf(file
, "# <| \n");
378 fprintf(file
, "# A \n");
379 fprintf(file
, "# /.\\ \n");
380 fprintf(file
, "# <| [\"\"M# \n");
381 fprintf(file
, "# A | # Clan McCloog Castle \n");
382 fprintf(file
, "# /.\\ [\"\"M# [Generated by the OpenScop ");
383 fprintf(file
, "Library %s %s bits]\n",OPENSCOP_RELEASE
, OPENSCOP_VERSION
);
384 fprintf(file
, "# [\"\"M# | # U\"U#U \n");
385 fprintf(file
, "# | # | # \\ .:/ \n");
386 fprintf(file
, "# | # | #___| # \n");
387 fprintf(file
, "# | \"--' .-\" \n");
388 fprintf(file
, "# |\"-\"-\"-\"-\"-#-#-## \n");
389 fprintf(file
, "# | # ## ###### \n");
390 fprintf(file
, "# \\ .::::'/ \n");
391 fprintf(file
, "# \\ ::::'/ \n");
392 fprintf(file
, "# :8a| # # ## \n");
393 fprintf(file
, "# ::88a ### \n");
394 fprintf(file
, "# ::::888a 8a ##::. \n");
395 fprintf(file
, "# ::::::888a88a[]:::: \n");
396 fprintf(file
, "# :::::::::SUNDOGa8a::::. .. \n");
397 fprintf(file
, "# :::::8::::888:Y8888:::::::::... \n");
398 fprintf(file
, "#::':::88::::888::Y88a______________________________");
399 fprintf(file
, "________________________\n");
400 fprintf(file
, "#:: ::::88a::::88a:Y88a ");
401 fprintf(file
, " __---__-- __\n");
402 fprintf(file
, "#' .: ::Y88a:::::8a:Y88a ");
403 fprintf(file
, "__----_-- -------_-__\n");
404 fprintf(file
, "# :' ::::8P::::::::::88aa. _ _- -");
405 fprintf(file
, "- --_ --- __ --- __--\n");
406 fprintf(file
, "#.:: :::::::::::::::::::Y88as88a...s88aa.\n");
410 fprintf(file
, "# [File generated by the OpenScop Library %s %s bits]\n",
411 OPENSCOP_RELEASE
,OPENSCOP_VERSION
);
414 fprintf(file
, "\nOpenScop\n\n");
415 fprintf(file
, "# =============================================== Global\n");
416 fprintf(file
, "# Language\n");
417 fprintf(file
, "%s\n\n", scop
->language
);
419 fprintf(file
, "# Context\n");
420 openscop_relation_print_openscop(file
, scop
->context
,
421 OPENSCOP_TYPE_DOMAIN
, names
);
424 openscop_names_print_openscop(file
, scop
->names
);
426 fprintf(file
, "# Number of statements\n");
427 fprintf(file
, "%d\n\n",openscop_statement_number(scop
->statement
));
429 openscop_statement_print_openscop(file
, scop
->statement
, names
);
433 fprintf(file
, "# ==============================================="
435 openscop_extension_print_openscop(file
, scop
->extension
);
438 openscop_names_free(names
);
442 /*****************************************************************************
444 *****************************************************************************/
449 openscop_scop_update_val(int * variable
, int value
)
451 if ((*variable
== OPENSCOP_UNDEFINED
) || (*variable
== value
))
454 fprintf(stderr
, "[OpenScop] Warning: number of iterators and "
455 "parameters inconsistency.\n");
460 openscop_scop_update_properties(openscop_relation_p relation
,
461 int nb_output_dims
, int nb_input_dims
,
464 if (relation
!= NULL
)
466 openscop_scop_update_val(&(relation
->nb_output_dims
), nb_output_dims
);
467 openscop_scop_update_val(&(relation
->nb_input_dims
), nb_input_dims
);
468 openscop_scop_update_val(&(relation
->nb_parameters
), nb_parameters
);
474 * openscop_scop_propagate_properties internal function:
475 * This function tries to propagate information in all relations through the
476 * whole openscop representation. For instance, the number of parameters can
477 * be found in the context as well as in any relation: if it is undefined in
478 * the relation, this function defines it, if it is different than the
479 * expected value, it reports an error. This function does the same for
480 * the number of output and input dimensions.
481 * \param scop The SCoP we want to propagate properties.
485 openscop_scop_propagate_properties(openscop_scop_p scop
)
487 int i
, nb_parameters
;
488 openscop_statement_p statement
;
489 openscop_relation_p relation
;
490 openscop_relation_list_p list
;
492 // Context part: get the number of parameters.
493 if ((scop
->context
!= NULL
) &&
494 (openscop_relation_is_matrix(scop
->context
)))
496 nb_parameters
= scop
->context
->nb_columns
- 2;
497 openscop_scop_update_properties(scop
->context
, 0, 0, nb_parameters
);
502 // For each statement:
503 statement
= scop
->statement
;
504 while (statement
!= NULL
)
507 relation
= statement
->domain
;
508 if (openscop_relation_is_matrix(relation
))
510 while (relation
!= NULL
)
512 openscop_scop_update_properties(relation
,
513 relation
->nb_columns
- nb_parameters
- 2, 0, nb_parameters
);
514 relation
= relation
->next
;
518 // - Scattering part,
519 relation
= statement
->scattering
;
520 if (openscop_relation_is_matrix(relation
))
522 while (relation
!= NULL
)
524 openscop_scop_update_properties(relation
,
525 0, relation
->nb_columns
- nb_parameters
- 2, nb_parameters
);
526 relation
= relation
->next
;
531 for (i
= 0; i
< 2; i
++)
534 list
= statement
->read
;
536 list
= statement
->write
;
540 relation
= list
->elt
;
541 if (openscop_relation_is_matrix(relation
))
543 while (relation
!= NULL
)
545 openscop_scop_update_properties(relation
,
546 0, relation
->nb_columns
- nb_parameters
- 2, nb_parameters
);
547 relation
= relation
->next
;
555 statement
= statement
->next
;
561 * openscop_scop_read function:
562 * this function reads a scop structure from a file (possibly stdin)
563 * complying to the OpenScop textual format and returns a pointer to this
564 * scop structure. If some relation properties (number of input/output/local
565 * dimensions and number of parameters) are undefined, it will define them
566 * according to the available information.
567 * \param file The file where the scop has to be read.
568 * \return A pointer to the scop structure that has been read.
571 openscop_scop_read(FILE * file
)
573 openscop_scop_p scop
= NULL
;
574 openscop_statement_p stmt
= NULL
;
575 openscop_statement_p prev
= NULL
;
584 scop
= openscop_scop_malloc();
590 // Ensure the file is a .scop.
591 tmp
= openscop_util_strings_read(file
, &max
);
592 if ((max
== 0) || (strcmp(*tmp
, "OpenScop")))
594 fprintf(stderr
, "[OpenScop] Error: not an OpenScop file "
595 "(type \"%s\".\n", *tmp
);
599 fprintf(stderr
, "[OpenScop] Warning: uninterpreted information "
600 "(after file type).\n");
604 // Read the language.
605 char ** language
= openscop_util_strings_read(file
, &max
);
608 fprintf(stderr
, "[OpenScop] Error: no language (backend) specified.\n");
612 fprintf(stderr
, "[OpenScop] Warning: uninterpreted information "
613 "(after language).\n");
614 scop
->language
= *language
;
618 scop
->context
= openscop_relation_read(file
);
619 scop
->names
= openscop_names_read(file
);
622 // II. STATEMENT PART
625 // Read the number of statements.
626 nb_statements
= openscop_util_read_int(file
, NULL
);
628 for (i
= 0; i
< nb_statements
; ++i
)
630 // Read each statement.
631 stmt
= openscop_statement_read(file
);
632 if (scop
->statement
== NULL
)
633 scop
->statement
= stmt
;
643 // Read the remainder of the file, and store it in the extension field.
644 scop
->extension
= openscop_extension_read(file
);
647 // VI. FINALIZE AND CHECK
649 openscop_scop_propagate_properties(scop
);
651 if (!openscop_scop_integrity_check(scop
))
652 fprintf(stderr
, "[OpenScop] Warning: global integrity check failed.\n");
658 /*+***************************************************************************
659 * Memory allocation/deallocation functions *
660 *****************************************************************************/
664 * openscop_scop_malloc function:
665 * this function allocates the memory space for a openscop_scop_t structure and
666 * sets its fields with default values. Then it returns a pointer to the
668 * \return A pointer to an empty scop with fields set to default values.
671 openscop_scop_malloc()
673 openscop_scop_p scop
;
675 scop
= (openscop_scop_p
)malloc(sizeof(openscop_scop_t
));
678 fprintf(stderr
, "[OpenScop] Memory Overflow.\n");
683 scop
->language
= NULL
;
684 scop
->context
= NULL
;
685 scop
->statement
= NULL
;
686 scop
->extension
= NULL
;
694 * openscop_scop_free function:
695 * This function frees the allocated memory for a openscop_scop_t structure.
696 * \param scop The pointer to the scop we want to free.
699 openscop_scop_free(openscop_scop_p scop
)
703 if (scop
->language
!= NULL
)
704 free(scop
->language
);
706 openscop_relation_free(scop
->context
);
707 openscop_names_free(scop
->names
);
708 openscop_statement_free(scop
->statement
);
709 openscop_extension_free(scop
->extension
);
716 /*+***************************************************************************
717 * Processing functions *
718 *****************************************************************************/
722 * openscop_scop_copy function:
723 * This functions builds and returns a "hard copy" (not a pointer copy)
724 * of a openscop_statement_t data structure provided as parameter.
725 * Note that the usr field is not touched by this function.
726 * \param statement The pointer to the scop we want to copy.
727 * \return A pointer to the full copy of the scop provided as parameter.
730 openscop_scop_copy(openscop_scop_p scop
)
732 openscop_scop_p copy
;
734 copy
= openscop_scop_malloc();
735 copy
->version
= scop
->version
;
736 copy
->language
= strdup(scop
->language
);
737 copy
->context
= openscop_relation_copy(scop
->context
);
738 copy
->names
= openscop_names_copy(scop
->names
);
739 copy
->statement
= openscop_statement_copy(scop
->statement
);
740 copy
->extension
= openscop_extension_copy(scop
->extension
);
747 * openscop_scop_equal function:
748 * this function returns true if the two scops are the same, false
749 * otherwise (the usr field is not tested).
750 * \param s1 The first scop.
751 * \param s2 The second scop.
752 * \return 1 if s1 and s2 are the same (content-wise), 0 otherwise.
755 openscop_scop_equal(openscop_scop_p s1
, openscop_scop_p s2
)
757 if (s1
->version
!= s2
->version
)
759 fprintf(stderr
, "[OpenScop] info: versions are not the same.\n");
763 if (strcmp(s1
->language
, s2
->language
) != 0)
765 fprintf(stderr
, "[OpenScop] info: languages are not the same.\n");
769 if (!openscop_relation_equal(s1
->context
, s2
->context
))
771 fprintf(stderr
, "[OpenScop] info: contexts are not the same.\n");
775 if (!openscop_names_equal(s1
->names
, s2
->names
))
777 fprintf(stderr
, "[OpenScop] info: names are not the same.\n");
781 if (!openscop_statement_equal(s1
->statement
, s2
->statement
))
783 fprintf(stderr
, "[OpenScop] info: statements are not the same.\n");
787 if (!openscop_extension_equal(s1
->extension
, s2
->extension
))
789 fprintf(stderr
, "[OpenScop] info: extensions are not the same.\n");
800 * openscop_scop_integrity_check function:
801 * This function checks that a scop is "well formed". It returns 0 if the
802 * check failed or 1 if no problem has been detected.
803 * \param scop The scop we want to check.
804 * \return 0 if the integrity check fails, 1 otherwise.
807 openscop_scop_integrity_check(openscop_scop_p scop
)
809 int expected_nb_parameters
;
810 int max_nb_parameters
;
811 int max_nb_iterators
;
812 int max_nb_scattdims
;
813 int max_nb_localdims
;
816 // Check the language.
817 if ((scop
->language
!= NULL
) &&
818 (!strcmp(scop
->language
, "caml") || !strcmp(scop
->language
, "Caml") ||
819 !strcmp(scop
->language
, "ocaml") || !strcmp(scop
->language
, "OCaml")))
820 fprintf(stderr
, "[OpenScop] Alert: What ?! Caml ?! Are you sure ?!\n");
822 // Check the context.
823 if (openscop_relation_is_matrix(scop
->context
))
825 if (!openscop_relation_integrity_check(scop
->context
,
826 OPENSCOP_TYPE_CONTEXT
,
832 // Get the number of parameters.
833 if (scop
->context
!= NULL
)
835 if (openscop_relation_is_matrix(scop
->context
))
836 expected_nb_parameters
= scop
->context
->nb_columns
- 2;
838 expected_nb_parameters
= scop
->context
->nb_parameters
;
841 expected_nb_parameters
= OPENSCOP_UNDEFINED
;
843 if (!openscop_statement_integrity_check(scop
->statement
,
844 expected_nb_parameters
))
847 // Ensure we have enough names.
848 openscop_scop_name_limits(scop
, &max_nb_parameters
,
854 return openscop_names_integrity_check(scop
->names
, expected_nb_parameters
,
855 max_nb_iterators
, max_nb_scattdims
);