summaryrefslogtreecommitdiffstats
path: root/content/zettel/3c3f7.md
blob: 830df58c67f15685577a8ae436d1c00be1342445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
+++
title = "Strict evaluation or lazy evaluation of predicates"
date = "2023-02-14"
author = "Yann Herklotz"
tags = []
categories = []
backlinks = ["3c3f6"]
forwardlinks = ["3c3f7a"]
zettelid = "3c3f7"
+++

Strict evaluation of predicates is the following:

$$\frac{\theta \vdash p_1 \Downarrow b_1 \qquad \theta \vdash p_2 \Downarrowb_2}{\theta \vdash p_1 \land p_2 \Downarrow b_1 \mathbin{\texttt{\&}} b_2}$$

Lazy evaluation of predicates will instead have multiple rules that take
into account when we know the result of the computation:

$$\frac{\theta \vdash p_1 \Downarrow \perp}{\theta \vdash p_1 \land p_2  \Downarrow \perp}$$

$$\frac{\theta \vdash p_2 \Downarrow \perp}{\theta \vdash p_1 \land p_2  \Downarrow \perp}$$

$$\frac{\theta \vdash p_1 \Downarrow \top \qquad \theta \vdash p_2  \Downarrow \top}{\theta \vdash p_1 \land p_2 \Downarrow \top}$$