Switching off invalid hashconsing

This commit is contained in:
Dmitry Boulytchev 2022-01-31 23:46:18 +03:00
parent f953814c76
commit 69c0b89e3c
6 changed files with 91 additions and 29 deletions

View file

@ -9,6 +9,7 @@ import Collection;
import Ref;
import Fun;
import Matcher;
import Data;
var tab, hct, restab, log = false;
@ -23,7 +24,7 @@ public fun initOstap () {
}
public fun memo (f) {
f := lookupMemo (hct, f);
-- f := lookupMemo (hct, f);
if log then printf ("Memoizing %x=%s\n", f, f.string) fi;
@ -135,6 +136,21 @@ public infix @ at * (a, f) {
}
}
public infix @@ at * ([name, a], f) {
fun (k) {
fun (s) {
var aa =
a (fun (x) {k (case x of
Succ (x, s) -> Succ (f (x), s)
| _ -> x
esac)});
-- printf ("aa=%s\n", aa.string);
-- printf ("@@: %s\n", name);
aa (s)
}
}
}
public fun lift (f) {
fun (x) {f}
}
@ -294,7 +310,7 @@ public fun expr (ops, opnd) {
{} -> fun (c) {opnd @ c}
| level : tl ->
var lops = altl (level),
next = inner (tl);
next = inner (tl);
case level.fst of
Nona ->