2.3 What is a well-defined expression?

2.3.1 Presentation

A mathematical expression is well-defined when it can be assigned a meaning (refer to Mdelta User Manual, version 1.0). On the opposite case, the expression would be said as meaningless. Any expression requiring conditions to avoid being meaningless is defined as potentially meaningless.

For example, given the expression:

y = -x--
    x+c8
(2.1)

This expression can be true or false, provided that it is well-defined. If this expression is not well-defined, it is then impossible to associate it a true or false value. This ill-definedness means that at least one operator of the expression has at least one operand that does not belong to its domain. Expression (3.1) is obviously arithmetic by nature. We consider that this expression is has been type-checked (operation performed by the type checker) so that y, x, and c are integers.

The operators appearing in the expression (3.1) are:

We will then have to check that:

To establish that expression (3.1) is well-defined, the user has to prove the following predicates:

(x + 8)∕c ⁄= 0
(2.2)

c ⁄= 0
(2.3)

The expression context has to contain these predicates in the form of hypotheses or to enable to deduce them.

If it is not the case, the expression (3.1) is potentially ill-defined. Refer to table (1) to see the list of the expressions that can be ill-defined.

2.3.2 Conditions of well-definedness

The well-definedness conditions are listed in the table below.



ExpressionCondition of well-definedness


ab a b
a mod b b 1 a
a∕b b 1
Π(x).(P|E){x|P}∈ FIN({x|P})
Σ(x).(P|E){x|P}∈ FIN({x|P})
max(S) S FIN() S
min(S) S ( -) FIN() S
card(S) S FIN(S)
inter(U) U
(x).(P|E){x|P}
rn n
f(x) x dom(f) f dom(f)  →↦  ran(f)
perm(S) S FIN(S)
conc(s) s seq(ran(s)) ∧∀x.(x dom(s)   s(x) seq(ran(s(x))))
s t s seq(ran(s)) t seq(ran(t))
size(s) s seq(ran(s))
rev(s) s seq(ran(s))
s e s seq(ran(s))
e s s seq(ran(s))
tail(s) size(s) 1 s seq(ran(s))
first(s) size(s) 1 s seq(ran(s))
front(s) size(s) 1 s seq(ran(s))
last(s) size(s) 1 s seq(ran(s))
s n n 0 .. size(s) s seq(ran(s))
s n n 0 .. size(s) s seq(ran(s))


 Table (1): Potentially meaningless expressions