French German Italian Spanish Portuguese Japanese Korean Chinese

When a variable of one mode is given in a position where a variable of another mode is expected,

There are two basic places in which mode coercion happens: in identity formulas and in predicate calls. In the descriptions that follow, we assume that all necessary type conversion has already taken place.

Any full-value **term** (any term made up only of constant terms, input variables, initialized output variables, initialized
input/output variables, and symbolic variables whose values are fixed as full-value terms) can also be considered an input variable.

**a**input,**b**input:**a**and**b**are compared.**a**input,**b**output: at compile time,**b**is made to refer to the same value (in memory) as**a**.**a**input,**b**symbolic: if**b**has a value, it is compared with**a**; otherwise,**b**gets the value of**a**if compatible with the constraints on**b**.**a**input,**b**input/output:**a**and**b**are compared.**a**output,**b**output:**b**is backtracked out if possible, and the values are assigned to**a**.**a**output,**b**symbolic: if**b**has a value, it is assigned to**a**; otherwise, it is backtracked out if possible, and the values are assigned to**a**.**a**output,**b**input/output:**a**is assigned a copy of the value of**b**.**a**symbolic,**b**symbolic: an equality constraint is put between the two variables.**a**symbolic,**b**input/output: if**a**has a value, it is compared with**b**; otherwise,**a**gets a copy of the value of**b**if compatible with the constraints on**a**.**a**input/output,**b**input/output:**a**and**b**are compared.

If the system attempts to backtrack out a variable and fails, it raises the "too many backtracks" run-time error.

class P(x mode T) iff ...where class is

**Mode coercion on predicate calls table:**

Mode of x (parameter) |
Mode of y (parameter) |
Action performed |

input | input | P(y) |

input | output | z :> T & z = y & P(z) |

input | symbolic | z :> T & z = y & P(z) |

input | i/o | z :> T & z = y & P(z) |

output | input | z :> T& P(z) & y = z |

output | output | P(y) |

output | symbolic | z :> T & P(z) & y = z |

output | i/o | z :> T & P(z) & y := z |

symbolic | input | z :: T & z = y & P(z) |

symbolic | output | z :: T & P(z) & y = z |

symbolic | symbolic | P(y) |

symbolic | i/o | z :: T& z = y & P(z) |

i/o | input | z :. T & z = y & P(z) |

i/o | output | z :. T & z := y & P(z) |

i/o | symbolic | z :. & z := y & P(z) |

i/o | i/o | P(y) |

Top Type Conversion Constraints