Open eaburns opened 5 years ago
That would sure be a nice thing to have, but that's not the way I'd go about doing it. Instead, I'd follow this 3-step plan:
To elaborate on (2.): the map would have regular predicate keys like "bu"
which would map to functions like (for the example of unary bu) ‘if the first argument is a proposition, unpack it and wrap it in Not{}
; otherwise, leave unchanged.’ (‘Leaving unchanged’ would be the mechanism for signalling to stop expanding/simplifying.) We could have similar transformations for mu, te, jeo (when x₂ is a verbatim property)…
If I understand, your 2 is a generalization of bu expansion, allowing to add more expansions of other predicates. That sounds fine to me. I think we should treat this as orthogonal to serial predicate expansion, which I do agree we should also do (probably behind a flag to turn it on and off).
Yes, your understanding is correct. (Sorry, I was in a hurry and didn't have the time to write clearly.) It would also be more implementationally transparent than 200-line-long procedures like:
func simplify(stuff *Stuff) Things {
switch stuff.predicate {
case "bu":
return simplify(simplifyBu(stuff))
case "mu":
return simplify(simplifyMu(stuff))
… (149 more cases)
}
:) Currently fighting at the serial expander front.
Unary bu is negation if it's argument is an abstraction or if it's the head of a serial. We should convert it to a new
Not
node in the logic tree and print it using¬
.