## lustrec / src / type_predef.ml @ 6afa892a

History | View | Annotate | Download (2.85 KB)

1 |
(* ---------------------------------------------------------------------------- |
---|---|

2 |
* SchedMCore - A MultiCore Scheduling Framework |

3 |
* Copyright (C) 2009-2011, ONERA, Toulouse, FRANCE - LIFL, Lille, FRANCE |

4 |
* |

5 |
* This file is part of Prelude |

6 |
* |

7 |
* Prelude is free software; you can redistribute it and/or |

8 |
* modify it under the terms of the GNU Lesser General Public License |

9 |
* as published by the Free Software Foundation ; either version 2 of |

10 |
* the License, or (at your option) any later version. |

11 |
* |

12 |
* Prelude is distributed in the hope that it will be useful, but |

13 |
* WITHOUT ANY WARRANTY ; without even the implied warranty of |

14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |

15 |
* Lesser General Public License for more details. |

16 |
* |

17 |
* You should have received a copy of the GNU Lesser General Public |

18 |
* License along with this program ; if not, write to the Free Software |

19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |

20 |
* USA |

21 |
*---------------------------------------------------------------------------- *) |

22 | |

23 |
(** Base types and predefined operator types. *) |

24 |
open Types |

25 | |

26 |
let type_int = new_ty Tint |

27 |
let type_real = new_ty Treal |

28 |
let type_bool = new_ty Tbool |

29 |
let type_clock ty = new_ty (Tclock ty) |

30 |
let type_const tname = new_ty (Tconst tname) |

31 |
let type_enum taglist = new_ty (Tenum taglist) |

32 |
let type_struct fieldlist = new_ty (Tstruct fieldlist) |

33 |
let type_tuple tl = new_ty (Ttuple tl) |

34 |
let type_arrow ty1 ty2 = new_ty (Tarrow (ty1, ty2)) |

35 |
let type_array d ty = new_ty (Tarray (d, ty)) |

36 |
let type_static d ty = new_ty (Tstatic (d, ty)) |

37 | |

38 | |

39 |
let type_unary_bool_op = |

40 |
new_ty (Tarrow (type_bool, type_bool)) |

41 | |

42 |
let type_unary_poly_op = |

43 |
let univ = new_univar () in |

44 |
type_arrow univ univ |

45 | |

46 |
let type_bin_int_op = |

47 |
type_arrow (type_tuple [type_int;type_int]) type_int |

48 | |

49 |
let type_bin_bool_op = |

50 |
type_arrow (type_tuple [type_bool;type_bool]) type_bool |

51 | |

52 |
let type_ite_op = |

53 |
let univ = new_univar () in |

54 |
type_arrow (type_tuple [type_bool;univ;univ]) univ |

55 | |

56 |
let type_bin_poly_op = |

57 |
let univ = new_univar () in |

58 |
type_arrow (type_tuple [univ;univ]) univ |

59 | |

60 |
let type_bin_comp_op = |

61 |
let univ = new_univar () in |

62 |
new_ty (Tarrow (new_ty (Ttuple [univ;univ]), type_bool)) |

63 | |

64 |
let type_univ_bool_univ = |

65 |
let univ = new_univar () in |

66 |
type_arrow (type_tuple [univ;type_bool]) univ |

67 | |

68 |
let type_bool_univ3 = |

69 |
let univ = new_univar () in |

70 |
type_arrow (type_tuple [type_bool;univ;univ]) univ |

71 | |

72 |
let type_access = |

73 |
let d = Dimension.mkdim Location.dummy_loc Dimension.Dunivar in |

74 |
let d' = Dimension.mkdim Location.dummy_loc Dimension.Dunivar in |

75 |
let univ = new_univar () in |

76 |
type_arrow (type_tuple [type_array d univ; type_static d' type_int]) univ |

77 | |

78 |
let type_power = |

79 |
let d = Dimension.mkdim Location.dummy_loc Dimension.Dunivar in |

80 |
let univ = new_univar () in |

81 |
type_arrow (type_tuple [univ; type_static d type_int]) (type_array d univ) |

82 | |

83 |
(* Local Variables: *) |

84 |
(* compile-command:"make -C .." *) |

85 |
(* End: *) |