Skip to content

Commit

Permalink
Updating: very very minorly
Browse files Browse the repository at this point in the history
  • Loading branch information
githwxi committed Sep 1, 2024
1 parent 95d0343 commit e052dfe
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 17 deletions.
81 changes: 81 additions & 0 deletions prelude/DATS/CATS/JS/gint000.cats
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
////////////////////////////////////////////////////////////////////////.
// //.
// Applied Type System //.
// //.
////////////////////////////////////////////////////////////////////////.

/*
** ATS/Xanadu - Unleashing the Potential of Types!
** Copyright (C) 2024 Hongwei Xi, ATS Trustful Software, Inc.
** All rights reserved
**
** ATS is free software; you can redistribute it and/or modify it under
** the terms of the GNU GENERAL PUBLIC LICENSE (GPL) as published by the
** Free Software Foundation; either version 3, or (at your option) any
** later version.
**
** ATS is distributed in the hope that it will be useful, but WITHOUT ANY
** WARRANTY; without even the implied warranty of MERCHANTABILITY or
** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
** for more details.
**
** You should have received a copy of the GNU General Public License
** along with ATS; see the file COPYING. If not, please write to the
** Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
** 02110-1301, USA.
*/

////////////////////////////////////////////////////////////////////////.
////////////////////////////////////////////////////////////////////////.
/*
Author: Hongwei Xi
Sun 01 Sep 2024 04:27:52 PM EDT
Authoremail: gmhwxiATgmailDOTcom
*/
////////////////////////////////////////////////////////////////////////.
////////////////////////////////////////////////////////////////////////.
//
function
XATS2JS_sint_lt_sint
(i1, i2)
{
return (i1 < i2) // HX: lt
}
function
XATS2JS_sint_gt_sint
(i1, i2)
{
return (i1 > i2) // HX: gt
}
//
function
XATS2JS_sint_lte_sint
(i1, i2)
{
return (i1 <= i2) // HX: lte
}
function
XATS2JS_sint_gte_sint
(i1, i2)
{
return (i1 >= i2) // HX: gte
}
//
function
XATS2JS_sint_eq_sint
(i1, i2)
{
return (i1 === i2) // HX: equal
}
function
XATS2JS_sint_neq_sint
(i1, i2)
{
return (i1 !== i2) // HX: noteq
}
//
////////////////////////////////////////////////////////////////////////.
////////////////////////////////////////////////////////////////////////.
// end of [ATS3/XANADU_prelude_DATS_CATS_JS_gint000.cats]
////////////////////////////////////////////////////////////////////////.
////////////////////////////////////////////////////////////////////////.
88 changes: 88 additions & 0 deletions prelude/DATS/CATS/JS/gint000.dats
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
(***********************************************************************)
(* *)
(* Applied Type System *)
(* *)
(***********************************************************************)

(*
** ATS/Xanadu - Unleashing the Potential of Types!
** Copyright (C) 2024 Hongwei Xi, ATS Trustful Software, Inc.
** All rights reserved
**
** ATS is free software; you can redistribute it and/or modify it under
** the terms of the GNU GENERAL PUBLIC LICENSE (GPL) as published by the
** Free Software Foundation; either version 3, or (at your option) any
** later version.
**
** ATS is distributed in the hope that it will be useful, but WITHOUT ANY
** WARRANTY; without even the implied warranty of MERCHANTABILITY or
** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
** for more details.
**
** You should have received a copy of the GNU General Public License
** along with ATS; see the file COPYING. If not, please write to the
** Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
** 02110-1301, USA.
*)

(* ****** ****** *)
(* ****** ****** *)
//
(*
Author: Hongwei Xi
Sun 01 Sep 2024 04:25:37 PM EDT
Authoremail: gmhwxiATgmailDOTcom
*)
//
(* ****** ****** *)
(* ****** ****** *)
//
#impltmp
<(*tmp*)>
sint_lt_sint
(i1, i2) =
(
XATS2JS_sint_lt_sint
(i1, i2)) where
{
#extern
fun
XATS2JS_sint_lt_sint
(i1: sint, i2: sint): bool = $extnam()
}
//
#impgtmp
<(*tmp*)>
sint_gt_sint
(i1, i2) =
(
XATS2JS_sint_gt_sint
(i1, i2)) where
{
#extern
fun
XATS2JS_sint_gt_sint
(i1: sint, i2: sint): bool = $extnam()
}
//
#impltmp
<(*tmp*)>
sint_eq_sint
(i1, i2) =
(
XATS2JS_sint_eq_sint
(i1, i2)) where
{
#extern
fun
XATS2JS_sint_eq_sint
(i1: sint, i2: sint): bool = $extnam()
}
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)

(* end of [ATS3/XANADU_prelude_DATS_CATS_JS_gint000.dats] *)
42 changes: 42 additions & 0 deletions prelude/SATS/bool000.sats
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,48 @@ bool_tostr(btf: bool): strn
//
(* ****** ****** *)
//
(*
HX-2024-09-01:
Sun 01 Sep 2024 04:45:43 PM EDT
*)
//
fun<>
bool_lt
{i,j:b0}
(bool(i), bool(j)): bool(i<j)
fun<>
bool_gt
{i,j:b0}
(bool(i), bool(j)): bool(i>j)
fun<>
bool_eq
{i,j:b0}
(bool(i), bool(j)): bool(i=j)
//
#symload < with bool_lt of 1000
#symload > with bool_gt of 1000
#symload = with bool_eq of 1000
//
fun<>
bool_lte
{i,j:b0}
(bool(i), bool(j)): bool(i<=j)
fun<>
bool_gte
{i,j:b0}
(bool(i), bool(j)): bool(i>=j)
fun<>
bool_neq
{i,j:b0}
(bool(i), bool(j)): bool(i!=j)
//
#symload <= with bool_lte of 1000
#symload >= with bool_gte of 1000
#symload != with bool_neq of 1000
//
(* ****** ****** *)
(* ****** ****** *)
//
fun
<a:t0>
bool_ifval
Expand Down
24 changes: 12 additions & 12 deletions prelude/SATS/gint000.sats
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ sint_print(i0: sint): void
//
fun<>
sint_lt_sint
{i,j:int}
{i,j:i0}
(x:sint(i), y:sint(j)): bool(i<j)
fun<>
sint_gt_sint
{i,j:int}
{i,j:i0}
(x:sint(i), y:sint(j)): bool(i>j)
fun<>
sint_eq_sint
{i,j:int}
{i,j:i0}
(x:sint(i), y:sint(j)): bool(i=j)
//
#symload < with sint_lt_sint of 1000
Expand All @@ -70,15 +70,15 @@ sint_eq_sint
//
fun<>
sint_lte_sint
{i,j:int}
{i,j:i0}
(x:sint(i), y:sint(j)): bool(i<=j)
fun<>
sint_gte_sint
{i,j:int}
{i,j:i0}
(x:sint(i), y:sint(j)): bool(i>=j)
fun<>
sint_neq_sint
{i,j:int}
{i,j:i0}
(x:sint(i), y:sint(j)): bool(i!=j)
//
#symload <= with sint_lte_sint of 1000
Expand All @@ -87,7 +87,7 @@ sint_neq_sint
//
fun<>
sint_cmp_sint
{i,j:int}
{i,j:i0}
(x:sint(i), y:sint(j)): sint(sgn(i-j))
//
#symload cmp with sint_cmp_sint of 1000
Expand All @@ -97,23 +97,23 @@ sint_cmp_sint
//
fun<>
sint_add_sint
{i,j:int}
{i,j:i0}
(x: sint(i), y: sint(j)): sint(i+j)
fun<>
sint_sub_sint
{i,j:int}
{i,j:i0}
(x: sint(i), y: sint(j)): sint(i-j)
fun<>
sint_mul_sint
{i,j:int}
{i,j:i0}
(x: sint(i), y: sint(j)): sint(i*j)
fun<>
sint_div_sint
{i,j:int}
{i,j:i0}
(x: sint(i), y: sint(j)): sint(i/j)
fun<>
sint_mod_sint
{i,j:int}
{i,j:i0}
(x: sint(i), y: sint(j)): sint(i%j)
//
#symload + with sint_add_sint of 1000
Expand Down
16 changes: 16 additions & 0 deletions srcgen2/prelude/HATS/prelude_JS_dats.hats
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ Sun 14 Jul 2024 12:14:49 PM EDT
(* ****** ****** *)
//
#staload _ =
"prelude/DATS/CATS/JS/bool000.dats"
//
(* ****** ****** *)
//
#staload _ =
"prelude/DATS/CATS/JS/char000.dats"
//
(* ****** ****** *)
//
#staload _ =
"prelude/DATS/CATS/JS/gint000.dats"
//
(* ****** ****** *)
(* ****** ****** *)
//
#staload _ =
"prelude/DATS/CATS/JS/strn000.dats"
//
(* ****** ****** *)
Expand Down
21 changes: 16 additions & 5 deletions srcgen2/prelude/HATS/prelude_dats.hats
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,23 @@ Sun 14 Jul 2024 12:14:49 PM EDT
(* ****** ****** *)
// prelude/DATS
(* ****** ****** *)
#staload _ = "prelude/DATS/gbas000.dats"
#staload _ = "prelude/DATS/gbas001.dats"
#staload _ = "prelude/DATS/gbas002.dats"
(* ****** ****** *)
#staload _ = "prelude/DATS/VT/gbas000_vt.dats"
#staload _ = "prelude/DATS/VT/gbas001_vt.dats"
#staload
_(*BAS*) =
"prelude/DATS/gbas000.dats"
#staload
_(*BAS*) =
"prelude/DATS/gbas001.dats"
#staload
_(*BAS*) =
"prelude/DATS/gbas002.dats"
(* ****** ****** *)
#staload
_(*BAS*) =
"prelude/DATS/VT/gbas000_vt.dats"
#staload
_(*BAS*) =
"prelude/DATS/VT/gbas001_vt.dats"
(* ****** ****** *)
(* ****** ****** *)
//
Expand Down

0 comments on commit e052dfe

Please sign in to comment.