ليس
Translation status: العربية reader-locale proof. Term names and code fences follow the ar pack; supporting prose may still be English.
Negates a boolean expression.
Aliases: !
Syntax: ليس <expression>
Category#
logic
Related#
Examples#
radix/corpus/non/non.fab (canonical · keyword)#
Negates a boolean expression.
test "non negates falsum" {
const bool flag ← false
const bool negated ← not flag
assert negated
}
test "non negates verum" {
const bool flag ← true
const bool negated ← not flag
assert negated ≡ false
}
test "non applied twice returns the original" {
const bool flag ← false
const bool negated ← not flag
const bool bis ← not negated
assert bis ≡ false
}
# =============================================================================
# ليس — Negates a boolean expression.
# =============================================================================
#
# What this teaches:
# • the `ليس` keyword — unary boolean negation (equivalent to `!`)
#
# Common mistakes:
# • Confusing ليس (logical negation) with ≠ (inequality comparison) — ليس negates a boolean, ≠ compares two values.
#
# See also: صواب, خطأ
# =============================================================================
# ليس — logical not
#
# GRAMMAR:
# unaryExpr :← 'ليس' expr
#
# EXPECTED OUTPUT:
# Scalar stdout smoke (see body).
#
main {
const bool flag ← false
const bool negated ← not flag
print negated
}Expected output:
verum