202212152212

Type :Note Tags : PLC


Partial Functions

Note

A Partial Function is a function that has values on some arguments but not on all arguments The reason why a function would not return all values are :

  • Error Termination: Evaluation of a function cannot proceed because of a conflict between the operator and an operand.
  • Nontermination: Evaluation of a function proceeds indefinitely. An example of the first case would be the expression x:= 3 / 0, because devision by 0 is undefined. An example of the second scenario can be a function f(x: int) := if x = 0 then 0 else x + f(x-2), this function does not terminate when 3 is given as an argument.

A partial function is not a function as defined by the mathematical sense. A mathematical function is a set of ordered pair satisfying the following conditions:

  1. If and , then .
  2. For every , there exists a such that . But a partial function only follows the first condition.

Related Problems


References