Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int isSymmetric(POINT *data, int count)
- {
- int i, j, propertypoints=0;
- for (i = 0; i < count + 1; i++)
- {
- for (j = 0; j < count + 1; j++)
- if ((data[i].x == data[j].y) && (data[i].y == data[j].x)) propertypoints++;
- }
- if (propertypoints == count + 1) return 1;
- else return 0;
- }
- int isTransitive(POINT *data, int *domain, int *range, int count)
- {
- if (isReflexive(data, domain, range, count) && isSymmetric(data, count)) return 1;
- else return 0;
- }
- void isEq(POINT *data, int *domain, int *range, int count)
- {
- printf("Reflexive = %s\n", isReflexive(data, domain, range, count) ? "TRUE" : "FALSE");
- printf("Symmetric = %s\n", isSymmetric(data, count) ? "TRUE" : "FALSE");
- printf("Transitive = %s\n",isTransitive(data, domain, range, count) ? "TRUE" : "FALSE");
- if (isReflexive(data, domain, range, count) && isSymmetric(data, count))
- printf("Equivalence = TRUE");
- else
- printf("Equivalence = FALSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement