
"SIGOURE" == SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> writes:
collect-static-const-decl = ?ConstInt(idf, value) - ; where(!value{Type("int")} => v) ; if <ExpandStaticConsts> idf then cannot-redefine-static-const(|idf) end ; if <ExpandFormulas> idf then cannot-redefine-formula(|idf) end
Why don't you factor your checkings into a "<check-redefinitions> idf"?
+ ; where(<innermost(ExpandStaticConsts + ExpandFormulas)> value => v' + ; !v'{Type("int")} => v) ; rules(ExpandStaticConsts: idf -> v)
collect-static-const-decl = ?ConstDouble(idf, value) - ; where(!value{Type("double")} => v) ; if <ExpandStaticConsts> idf then cannot-redefine-static-const(|idf) end ; if <ExpandFormulas> idf then cannot-redefine-formula(|idf) end + ; where(<innermost(ExpandStaticConsts + ExpandFormulas)> value => v' + ; !v'{Type("double")} => v) ; rules(ExpandStaticConsts: idf -> v)
collect-static-const-decl = ?ConstBool(idf, value) - ; where(!value{Type("bool")} => v) ; if <ExpandStaticConsts> idf then cannot-redefine-static-const(|idf) end ; if <ExpandFormulas> idf then cannot-redefine-formula(|idf) end + ; where(<innermost(ExpandStaticConsts + ExpandFormulas)> value => v' + ; !v'{Type("bool")} => v) ; rules(ExpandStaticConsts: idf -> v)
Also, the truplicate where clause seems truplication of code...