Computing Reviews

Transforming Boolean equalities into constraints
Antoy S., Hanus M. Formal Aspects of Computing29(3):475-494,2017.Type:Article
Date Reviewed: 09/13/17

In declarative programming languages, a variable is a symbol representing a value determined by computational rules rather than a space in memory. The two main forms of declarative languages are functional and logic. In functional languages, variables are linked to expressions, with computation resulting in an expression being simplified to its final form as a value.

Logic languages work on a different principle. Computation involves testing whether an expression is valid. An expression may contain unassigned variables, and the testing may involve giving them values necessary to make the expression valid. Logic languages can be indeterminate, meaning there may be more than one value a variable could be given. If a variable is shared, computation of one expression may backtrack to give a variable an alternative value if that is needed to make the other expression valid.

Curry is a leading example of attempts to combine these two forms in one programming language. As such, it requires two equality operators. These are x==y, the functional form that waits until x and y are fully evaluated, and the logic form x=:=y that can work by assigning either variable the value of the other if it is unassigned.

The subtle distinction between these two forms of equality can be hard to follow and may lead to inefficiency. This paper proposes avoiding that by having a single equality operator, and shows how automated analysis of a program can determine those occasions when it should work like =:= rather than ==.

Reviewer:  M. Huntbach Review #: CR145535 (1711-0737)

Reproduction in whole or in part without permission is prohibited.   Copyright 2024 ComputingReviews.com™
Terms of Use
| Privacy Policy