abstract class Dual(val rank: Int) { | |
self => | |
// Cell value accessor | |
protected def get(r: Int, c: Int): Double | |
// Memoizing cell value accessor | |
def apply(r: Int, c: Int): Double = memo.getOrElseUpdate(r - c, self.get(r, c)) | |
// The memo table |
This is an extension of "A Very General Method of Computing Shortest Paths" to use "open matrices". | |
This is from a paper "The Open Algebraic Path Problem" by Jade Master https://arxiv.org/abs/2005.06682 | |
> {-# LANGUAGE TypeFamilies #-} | |
> {-# LANGUAGE TypeApplications #-} | |
> {-# LANGUAGE FlexibleContexts #-} | |
> {-# LANGUAGE StandaloneDeriving #-} | |
> {-# LANGUAGE AllowAmbiguousTypes #-} | |
> {-# LANGUAGE ScopedTypeVariables #-} | |
> module OpenStarSemiring where |
using DSP: conv | |
@assert conv([1, 0, 0], 1:4) .+ # [1, 2, 3, 4, 0, 0] | |
conv([0, 2, 0], 1:4) .+ # [0, 2, 4, 6, 8, 0] | |
conv([0, 0, 3], 1:4) == # [0, 0, 3, 6, 9, 12] | |
conv([1, 2, 3], 1:4) # [1, 4, 10, 16, 17, 12] |
using LinearAlgebra: diag | |
# returns a `LinRange` representing `k`s which can | |
# be passed into `diag`, starting from top right | |
function diags(m::AbstractMatrix) | |
(nr, nc) = size(m) .- 1 | |
return reverse(-nr:nc) | |
end | |
# sum of values along diagonal, `diagsum(m, 0) == tr(m)` |
Jason the Goodman <[email protected]>:
How about defining "truth" with "stability" of the coupling loop between "the object" and the cognitive system coupling with the "object"? If the process stabilizes and an eigenvalue of the loop emerges, we say "a truth" is found. This would refocus our attention from the "object" itself to the nature of the cognitive system, which may include animals and robots in addition to humans. My tentative way to upgrade from first-order thinking to the second-order thinking. Then, instead of searching for "truth", we search for the "Lyapunov potential function" for the situation if we could find one...
Louis H Kauffman <[email protected]>
Eigenform is important way to formalize a kind of stability. Truth is a special kind of eigenform, not just any eigenform. Truth means the truth of a PROPOSITION about something. So we need to have a language involved and the notion that the propositions are talking about some domain where it is possible to c
struct User : Equatable { | |
let id: UInt | |
let selected: Bool | |
} | |
var z = (0...10).map { User(id: $0, selected: $0 == 3 || $0 == 6 || $0 == 10) } | |
var q = (0...10).map { User(id: $0, selected: $0 == 3 || $0 == 6 || $0 == 10) } | |
z.gather(at: 0) { $0.selected } | |
z.gather(at: 5) { $0.selected } |
Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "lldb", | |
"request": "launch", | |
"name": "Debug", | |
"program": "${workspaceRoot}/target/debug/${workspaceRootFolderName}", | |
"args": [], | |
"cwd": "${workspaceRoot}", |