Skip to content

Commit d0a33ad

Browse files
committed
up
1 parent 80f279f commit d0a33ad

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

docs/diary/2024-09-16-propagator-model-and-lattice.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,5 @@ Structural Subtyping 作为 Lattice,
4343
但是可以看成是以 record lattice 为基础来定义的,
4444
就像是以 free group 为基础来定义 presentation of a group。
4545

46-
具体地说:
47-
48-
- Belief 的结构是 {}
49-
50-
- BeliefSystem 的结构是 `Record<Set, Belief>`
51-
52-
用类似 structural subtyping 的方式来统一理解所有 lattice
46+
Belief 与 BeliefSystem 作为 lattice 之间的关系非常复杂,
47+
要看具体的 merge 函数的定义。

src/examples/barometer-belief-system.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ test("examples / barometer-belief-system", async () => {
9090
// them. The reasoning behind this design decision was that, in my
9191
// experience, it was not a good idea to compute all the
9292
// consequences of all the premises all the time; rather we just
93-
// compute the strongest consequence of all the premises in the
94-
// current worldview taken together. The current worldview at this
95-
// point believes both shadows and fall-time, because we made
96-
// believing everything the default, and that default has not yet
97-
// been overridden.
93+
// compute the strongest [most information] consequence of all the
94+
// premises in the current worldview taken together. The current
95+
// worldview at this point believes both shadows and fall-time,
96+
// because we made believing everything the default, and that
97+
// default has not yet been overridden.
9898

9999
// In this particular system, we chose to make the worldview
100100
// implicit and global. That works fine on a uniprocessor, but a

src/monad/belief-system-monad.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ import { flatten, fmap } from "./monad.js"
1212
// pack the result up into a (one-item) belief system.
1313
//
1414
// The only choice made here is that we are following the philosophy
15-
// set out in the main text of operating on the strongest possible
16-
// consequences of what we currently believe (as found by the query)
17-
// rather than on all variations of everything we might believe.
15+
// set out in the main text of operating on the most informative
16+
// possible consequences of what we currently believe (as found by the
17+
// query) rather than on all variations of everything we might
18+
// believe.
1819

1920
defineHandler(
2021
fmap,
2122
[isFunction, isBeliefSystem],
2223
(f, ma: BeliefSystem<any>) => {
23-
const strongestBelief = beliefSystemQuery(ma)
24-
return BeliefSystem([fmap(f, strongestBelief)])
24+
const bestBelief = beliefSystemQuery(ma)
25+
return BeliefSystem([fmap(f, bestBelief)])
2526
},
2627
)
2728

@@ -52,17 +53,17 @@ defineHandler(
5253
// with a belief system inside (namely incorporate the reasons of that
5354
// belief into the beliefs of that belief system).
5455
//
55-
// This handler also uses query to consider only the strongest belief
56-
// of the inner belief system.
56+
// This handler also uses query to consider only the most informative
57+
// belief of the inner belief system.
5758

5859
defineHandler(
5960
flatten,
6061
[(mma) => isBelief(mma) && isBeliefSystem(mma.value)],
6162
(mma: Belief<BeliefSystem<any>>) => {
6263
const innerBeliefSystem = mma.value
63-
const strongestBelief = beliefSystemQuery(innerBeliefSystem)
64+
const bestBelief = beliefSystemQuery(innerBeliefSystem)
6465
const newBeliefSystem = BeliefSystem(
65-
flatten(Belief(strongestBelief, mma.reasons)),
66+
flatten(Belief(bestBelief, mma.reasons)),
6667
)
6768
return flatten(newBeliefSystem)
6869
},

0 commit comments

Comments
 (0)