Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Sep 2, 2024
1 parent 265b3de commit 9af19e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/belief-system/beliefSystemMerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function assimilateOne<A, B>(
// from that in some beliefs already in the belief system. If so, we
// can just throw the new one away.

if (base.beliefs.some((oldBelief) => stronger(oldBelief, belief))) {
if (base.beliefs.some((oldBelief) => isStronger(oldBelief, belief))) {
return base
}

Expand All @@ -64,7 +64,7 @@ function assimilateOne<A, B>(
// 前者还包含了偏序关系中不可比较的情况。

const strongerOldBeliefs = base.beliefs.filter(
(oldBelief) => !stronger(belief, oldBelief),
(oldBelief) => !isStronger(belief, oldBelief),
)

return BeliefSystem<A | B>([...strongerOldBeliefs, belief])
Expand All @@ -81,7 +81,7 @@ function assimilateOne<A, B>(
// 注意,这与用 merge 所定义的 belief 之间的 implies 不同,
// merge 两个 belief 时,不是 reasons 集合之间求交,而是求并。

function stronger<A, B>(x: Belief<A>, y: Belief<B>): boolean {
function isStronger<A, B>(x: Belief<A>, y: Belief<B>): boolean {
return implies(x.value, y.value) && setIsSubsetOf(x.reasons, y.reasons)
}

Expand Down

0 comments on commit 9af19e2

Please sign in to comment.