mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-05-06 14:59:38 +02:00
Refactor repo structure
This commit is contained in:
parent
36ac339086
commit
8fc89fbc03
1732 changed files with 3812 additions and 67 deletions
19
Data/Questions/ingsw/1122_14/correct.txt
Normal file
19
Data/Questions/ingsw/1122_14/correct.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
<pre>
|
||||
#define n 1000
|
||||
int TestOracle1(int *A, int *B)
|
||||
{
|
||||
int i, j, D[n];
|
||||
//init
|
||||
|
||||
for (i = 0; i < n; i++) D[i] = -1;
|
||||
|
||||
// B is ordered
|
||||
for (i = 0; i < n; i++) { for (j = i+1; j < n; j++) {if (B[j] < B[i]) {retun (0);}}}
|
||||
// B is a permutation of A
|
||||
for (i = 0; i < n; i++) { for (j = 0; j < n; j++) {if ((A[i] == B[j]) && (D[j] == -1)) {C[i][j] = 1; D[j] = 1; break;}
|
||||
|
||||
for (i = 0; i < n; i++) {if (D[i] == -1) return (0);}
|
||||
// B ok
|
||||
return (1);
|
||||
}
|
||||
</pre>
|
7
Data/Questions/ingsw/1122_14/quest.txt
Normal file
7
Data/Questions/ingsw/1122_14/quest.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
Un test oracle per un programma P è una funzione booleana che ha come inputs gli inputs ed outputs di P e ritorna true se e solo se il valore di output di P (con i dati inputs) è quello atteso dalle specifiche.
|
||||
|
||||
Si consideri la seguente specifica funzionale per la funzione f.
|
||||
|
||||
La funzione f(int *A, int *B) prende come input un vettore A di dimensione n ritorna come output un vettore B ottenuto ordinando gli elementi di A in ordine crescente.
|
||||
|
||||
Quale delle seguenti funzioni è un test oracle per la funzione f?
|
29
Data/Questions/ingsw/1122_14/wrong 1.txt
Normal file
29
Data/Questions/ingsw/1122_14/wrong 1.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
<pre>
|
||||
#define n 1000
|
||||
|
||||
int TestOracle2(int *A, int *B)
|
||||
|
||||
{
|
||||
|
||||
int i, j, D[n];
|
||||
|
||||
//init
|
||||
|
||||
for (i = 0; i < n; i++) D[i] = -1;
|
||||
|
||||
// B is ordered
|
||||
|
||||
for (i = 0; i < n; i++) { for (j = i+1; j < n; j++) {if (B[j] < B[i]) {retun (0);}}}
|
||||
|
||||
// B is a permutation of A
|
||||
|
||||
for (i = 0; i < n; i++) { for (j = 0; j < n; j++) {if ((A[i] == B[j]) && (D[j] == -1)) {C[i][j] = 1; break;}
|
||||
|
||||
for (i = 0; i < n; i++) {if (D[i] == -1) return (0);}
|
||||
|
||||
// B ok
|
||||
|
||||
return (1);
|
||||
|
||||
}
|
||||
</pre>
|
29
Data/Questions/ingsw/1122_14/wrong 2.txt
Normal file
29
Data/Questions/ingsw/1122_14/wrong 2.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
<pre>
|
||||
#define n 1000
|
||||
|
||||
int TestOracle3(int *A, int *B)
|
||||
|
||||
{
|
||||
|
||||
int i, j, D[n];
|
||||
|
||||
//init
|
||||
|
||||
for (i = 0; i < n; i++) D[i] = -1;
|
||||
|
||||
// B is ordered
|
||||
|
||||
for (i = 0; i < n; i++) { for (j = i+1; j < n; j++) {if (B[j] < B[i]) {retun (0);}}}
|
||||
|
||||
// B is a permutation of A
|
||||
|
||||
for (i = 0; i < n; i++) { for (j = 0; j < n; j++) {if (A[i] == B[j]) {C[i][j] = 1; D[j] = 1; break;}
|
||||
|
||||
for (i = 0; i < n; i++) {if (D[i] == -1) return (0);}
|
||||
|
||||
// B ok
|
||||
|
||||
return (1);
|
||||
|
||||
}
|
||||
</pre>
|
Loading…
Add table
Add a link
Reference in a new issue