Kết xuấtvi

không

Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.

Negates a boolean expression.

Aliases: !

Syntax: không <expression>

Category#

logic

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
}
# =============================================================================
# không — Negates a boolean expression.
# =============================================================================
#
# What this teaches:
#   • the `không` keyword — unary boolean negation (equivalent to `!`)
#
# Common mistakes:
#   • Confusing không (logical negation) with ≠ (inequality comparison) — không negates a boolean, ≠ compares two values.
#
# See also: đúng, sai
# =============================================================================

# không — logical not
#
# GRAMMAR:
#   unaryExpr :← 'không' expr
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#

main {
    const bool flag ← false
    const bool negated ← not flag
    print negated
}

Expected output:

verum