fix type annotation for comparison expressions

This commit is contained in:
2020-01-27 16:57:09 +01:00
parent 86468ea740
commit fa8904e0f5
3 changed files with 48 additions and 18 deletions

View File

@@ -1,11 +1,11 @@
#include <stdbool.h>
int eq(int x, int y);
int neq(int x, int y);
int lt(int x, int y);
int lte(int x, int y);
int gt(int x, int y);
int gte(int x, int y);
bool eq(int x, int y);
bool neq(int x, int y);
bool lt(int x, int y);
bool lte(int x, int y);
bool gt(int x, int y);
bool gte(int x, int y);
bool and(bool a, bool b);
bool or(bool a, bool b);

View File

@@ -109,27 +109,27 @@ function fac(x: int): int {
return 1;
}
function eq(x: int, y: int): int {
function eq(x: int, y: int): bool {
return (x == y);
}
function neq(x: int, y: int): int {
function neq(x: int, y: int): bool {
return (x != y);
}
function lt(x: int, y: int): int {
function lt(x: int, y: int): bool {
return (x < y);
}
function lte(x: int, y: int): int {
function lte(x: int, y: int): bool {
return (x <= y);
}
function gt(x: int, y: int): int {
function gt(x: int, y: int): bool {
return (x > y);
}
function gte(x: int, y: int): int {
function gte(x: int, y: int): bool {
return (x >= y);
}