• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A categorical programming language


Commit MetaInfo

Revision97a7a3ed2f25a148e138e7dedb43af9b84a405b4 (tree)
Time2024-05-24 14:09:14
AuthorCorbin <cds@corb...>
CommiterCorbin

Log Message

jelly: Fix the problematic rule.

Change Summary

Incremental Difference

--- a/jelly/src/main.rs
+++ b/jelly/src/main.rs
@@ -54,13 +54,6 @@ impl CostFunction<SymbolLang> for CAMCostModel {
5454 }
5555 }
5656
57-// XXX doesn't typecheck!?
58-// fn isNotNil<L, N>(var :&'static str) -> impl Fn(&mut EGraph<L, N>, Id, &Subst) -> bool {
59-// let v = var.parse().unwrap();
60-// let nil = "nil".parse().unwrap();
61-// move |egraph, _, subst| !egraph[subst[v]].nodes.contains(&nil)
62-// }
63-
6457 // Hagino 1987: https://web.sfc.keio.ac.jp/~hagino/index.html.en
6558 // Cousineau, Curien, & Mauny 1987: https://doi.org/10.1016/0167-6423(87)90020-7
6659 // Wadler 1989: https://www2.cs.sfu.ca/CourseCentral/831/burton/Notes/July14/free.pdf
@@ -129,8 +122,7 @@ fn main() -> std::io::Result<()> {
129122 // pair-precompose when ?g is id
130123 rw!("pair-factor-snd"; "(pair (comp ?r ?f) ?r)" => "(comp ?r (pair ?f id))"),
131124 // pair-precompose when ?f and ?g are id
132- // XXX This is not type-correct when ?r is nil.
133- rw!("pair-factor-both"; "(pair ?r ?r)" => "(comp ?r dup)"), // if isNotNil("?r")),
125+ rw!("pair-factor-both"; "(comp ?r dup)" => "(pair ?r ?r)"),
134126
135127 // jet for pair/dup
136128 rw!("pair-dup-jet"; "(pair id id)" => "dup"),