Types
TruthValue = ref object
- Object corresponds to truth value. Two truth values "True" and "False" are distinguished by a private field.
Lets
BOTTOM = TruthValue(value: false)
- Logical constant represents false.
TOP = TruthValue(value: true)
- Logical constatnt represents true.
Procs
proc `$`(val: TruthValue): string {....raises: [], tags: [], forbids: [].}
- Stringify procedure for TruthValue. Returns "T" if val is TOP and "F" otherwise.
proc `==`(left, right: TruthValue): bool {....raises: [], tags: [], forbids: [].}
- Compare two truth values.
proc `and`(left, right: TruthValue): TruthValue {....raises: [], tags: [], forbids: [].}
- Returns TOP if both left and right are TOP and BOTTOM otherwise.
proc `not`(val: TruthValue): TruthValue {....raises: [], tags: [], forbids: [].}
- Returns BOTTOM if val is TOP and TOP otherwise.
proc `or`(left, right: TruthValue): TruthValue {....raises: [], tags: [], forbids: [].}
- Returns TOP if left or right are TOP and BOTTOM otherwise.