Data update

This commit is contained in:
Ingy dot Net 2024-04-19 16:56:29 -07:00
parent 0df55f9f24
commit aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions

View file

@ -25,18 +25,18 @@ func timp x y .
.
return x
.
print " (AND) ( OR) (EQV) (IMP) (NOT)"
print " F ? T F ? T F ? T F ? T "
print " -------------------------------------------------"
print " (AND) ( OR) (EQV) (IMP) (NOT)"
print " F ? T F ? T F ? T F ? T "
print " -----------------------------------------"
for i = -1 to 1
o$ = " " & sym$[i] & " | "
o$ &= sym$[tand -1 i] & " " & sym$[tand 0 i] & " " & sym$[tand 1 i]
o$ &= " "
o$ &= " "
o$ &= sym$[tor -1 i] & " " & sym$[tor 0 i] & " " & sym$[tor 1 i]
o$ &= " "
o$ &= " "
o$ &= sym$[timp -1 i] & " " & sym$[timp 0 i] & " " & sym$[timp 1 i]
o$ &= " "
o$ &= " "
o$ &= sym$[timp -1 i] & " " & sym$[timp 0 i] & " " & sym$[timp 1 i]
o$ &= " " & sym$[tnot i]
o$ &= " " & sym$[tnot i]
print o$
.

View file

@ -1,26 +1,26 @@
# borrowing null for "maybe"
val .trSet = [false, null, true]
val .and = f switch[and] .a, .b {
val .and = fn(.a, .b) switch[and] .a, .b {
case true, null:
case null, true:
case null: null
default: .a and .b
}
val .or = f switch[and] .a, .b {
val .or = fn(.a, .b) switch[and] .a, .b {
case false, null:
case null, false:
case null: null
default: .a or .b
}
val .imply = f if(.a nor .b: not? .a; .b)
val .imply = fn(.a, .b) if(.a nor .b: not? .a; .b)
# formatting function for the result values
# replacing null with "maybe"
# using left alignment of 5 code points
val .F = f $"\{nn [.r, "maybe"]:-5}"
val .F = fn(.r) $"\{nn [.r, "maybe"]:-5}"
writeln "a not a"
for .a in .trSet {

View file

@ -65,19 +65,17 @@ const func trit: (in trit: aTrit1) or (ref func trit: aTrit2) is func
end if;
end func;
$ syntax expr: .().xor.() is -> 15;
syntax expr: .().xor.() is -> 15;
const func trit: (in trit: aTrit1) xor (in trit: aTrit2) is
return tritImplies[succ(ord(aTrit1))][succ(ord(aTrit2))];
const func trit: (in trit: aTrit1) -> (in trit: aTrit2) is
return tritImplies[succ(ord(aTrit1))][succ(ord(aTrit2))];
syntax expr: .(). == .() is <-> 12;
const func trit: (in trit: aTrit1) == (in trit: aTrit2) is
return tritEquiv[succ(ord(aTrit1))][succ(ord(aTrit2))];
const func trit: rand (in trit: low, in trit: high) is
return trit conv (rand(ord(low), ord(high)));
# Begin of test code
var trit: operand1 is False;