Is there a way, in JavaScript or C#, to determine the outcome of a logical expression before the 
values of all variables have been retrieved?

Or to put it differently; can an expression be evaluated such that it returns either 'true', 'false', or 'maybe'? Wherein 'maybe' indicates that more data is needed.

To explain: I have a process in which it takes some time to retrieve data from the database backend and I would like to see if we can skip retrieving certain data if not necessary. But the logical expressions have been predetermined and can not be changed or taken apart.

For instance, consider the following expression:

```
((a = 1) and (b = 2)) or (c = 3)

```

There are several possibilities:
If `a` and `b` have been retrieved but `c` has not yet been retrieved:

* If `a=1` and `b=2` then the expression will always return true and I can skip retrieving the value for `c`
* If `a=0` and `b=2` then the first part will be false, and I need to retrieve the value for `c` in order to being able to determine the outcome

If `c` has been retrieved, but and `a` and `b` have not yet been retrieved.

* If `c=3` then the expression will always return true and I can skip retrieving the value for `a` and `b`.
* If `c=2` then the first part will be false, and I need to retrieve the value for `a` and `b` in order to being able to determine the outcome

In these situations, just knowing that an outcome is already determined, or that more data is needed can significantly speed up a process.

Does anybody have an idea? A process, function, algorithm?