Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the requirements a computer function must meet to be considered "monotonic"?

What are the requirements a computer function/procedure/predicate must meet to be considerd "monotonic"?

Let A be some thing ,
Let B be some thing ,
Let R be a monotonic relationship between A and B ,
Let R_ be a non-monotonic relationship between A and B ,
Let R become false if R_ is true ,
Let R_ become true if R is false ,
Let C be a constraint in consideration of R ,
Let C become false if R_ is true ,
Let D be the collection of constraints C (upon relationship R) .

**What is D ?**

I have reviewed some literature, e.g. a Wikipedia article "monotonic function". I am most interested in a practical set of criteria I can apply when pragmatically involved with computer programming. What are some tips and best practices I should follow when creating and designing my functions, such that they are more likely to be "monotonic"?

like image 865
Kintalken Avatar asked Apr 10 '17 03:04

Kintalken


People also ask

How do you determine if a function is monotonic?

A monotonic function is a function that is either always increasing or always decreasing on its domain. To check if a function is monotonic, find its derivative and see if it is greater than or equal to zero (monotonically increasing) or lesser than or equal to zero (monotonically decreasing).

What makes something monotonic?

A monotonic function is a function which is either entirely nonincreasing or nondecreasing. A function is monotonic if its first derivative (which need not be continuous) does not change sign.

How do you prove that an equation is monotonic?

Test for monotonic functions states: Suppose a function is continuous on [a, b] and it is differentiable on (a, b). If the derivative is larger than zero for all x in (a, b), then the function is increasing on [a, b]. If the derivative is less than zero for all x in (a, b), then the function is decreasing on [a, b].

What is meant by monotonic function?

In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order theory.


1 Answers

In logic programming, and also in logic, the classification "monotonic" almost invariably refers to monotonicity of entailment.

This fundamental property is encountered for example in classical first-order logic: When you are able to derive a consequence from a set of clauses, then you can also derive the consequence when you extend the set of clauses. Conversely, removing a clause does not entail consequences that were previously not the case.

In the pure subset of Prolog, this property also holds, from a declarative perspective. We therefore sometimes call it the pure monotonic subset of Prolog, since impurities do not completely coincide with constructs that destroy monotonicity.

Monotonicity of entailment is the basis and sometimes even necessary condition for several approaches that reason over logic programs, notably declarative debugging.

Note that Prolog has several language constructs that may prevent such reasoning in general. Consider for example the following Prolog program:

f(a).
f(b).
f(c).

And the following query:

?- setof(., f(X), [_,_]).
false.

Now I remove one of the facts from the program, which I indicate by strikethrough text:

f(a) :- false.
f(b).
f(c).

If Prolog programs were monotonic, then every query that previously failed would definitely now fail all the more, since I have removed something that was previously the case.

However, we now have:

?- setof(X, f(X), [_,_]).
true.

So, setof/3 is an example of a predicate that violates monotonicity!

like image 110
mat Avatar answered Sep 20 '22 18:09

mat