Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

understanding referential transparency

Generally, I have a headache because something is wrong with my reasoning:

  1. For 1 set of arguments, referential transparent function will always return 1 set of output values.

  2. that means that such function could be represented as a truth table (a table where 1 set of output parameters is specified for 1 set of arguments).

  3. that makes the logic behind such functions is combinational (as opposed to sequential)

  4. that means that with pure functional language (that has only rt functions) it is possible to describe only combinational logic.

The last statement is derived from this reasoning, but it's obviously false; that means there is an error in reasoning. [question: where is error in this reasoning?]

UPD2. You, guys, are saying lots of interesting stuff, but not answering my question. I defined it more explicitly now. Sorry for messing up with question definition!

like image 608
Vladimir Keleshev Avatar asked Jul 16 '10 20:07

Vladimir Keleshev


1 Answers

Question: where is error in this reasoning?

A referentially transparent function might require an infinite truth table to represent its behavior. You will be hard pressed to design an infinite circuit in combinatory logic.

Another error: the behavior of sequential logic can be represented purely functionally as a function from states to states. The fact that in the implementation these states occur sequentially in time does not prevent one from defining a purely referentially transparent function which describes how state evolves over time.

like image 63
Norman Ramsey Avatar answered Sep 21 '22 20:09

Norman Ramsey