juan_gandhi: (Default)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote2019-05-19 01:03 pm
Entry tags:

еще похвастаться

 def checkDistributivity(cat: Category): MatchResult[Any] = {
  val topos = new CategoryOfDiagrams(cat)
import topos._
val points = Ω.points

val desc = s"Testing ${cat.name} distributivity laws"
println(desc)

for { pt1 ← points } {
println(s" at ${pt1.tag}")
val p = predicateFor(pt1)

for { pt2 ← points } {
val q = predicateFor(pt2)
val pAndQ = p ∧ q
val pOrQ = p ∨ q

for { pt3 ← points } {
val r = predicateFor(pt3)
// distributivity of conjunction over disjunction
(p ∧ (q ∨ r)) === (pAndQ ∨ (p ∧ r))
// distributivity of disjunction over conjunction
(p ∨ (q ∧ r)) === (pOrQ ∧ (p ∨ r))
}
}
}

ok
}

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting