Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
31d0d37
Merge branch 'cleanup/let-var-flow' into feature/stitch-syns
krame505 Oct 6, 2025
bc5b142
Initial progress on reworking flow analysis to consider syn and eq ve…
krame505 Oct 7, 2025
37d3769
More work on supporting and using tile stitch points
krame505 Oct 9, 2025
916abd4
Use the name of the child in projectionStitchPoint instead of a VT th…
krame505 Oct 9, 2025
ffc545c
Cleanup unused utilities, just do the initial transitive closure in c…
krame505 Oct 9, 2025
68cf64c
Further refactoring to production graphs, merge tile graphs with regu…
krame505 Oct 10, 2025
734885b
Update graph dumping, also dump tile graphs
krame505 Oct 11, 2025
092d45e
Fix bugs with implicit sharing eqs and tile stitch points for subterm…
krame505 Oct 11, 2025
b965e1e
Dump stitch points for debugging with --dump-flow-graphs
krame505 Oct 11, 2025
7f9e085
Apparently specs for 'decorate' were ending up in prod flow graphs vi…
krame505 Oct 11, 2025
aa46f53
Fix some bugs in flow edge / stitch point computation
krame505 Oct 11, 2025
82e9d5d
Updated test case due to changes in syn dep tracking
krame505 Oct 11, 2025
d8ddaac
Darn, apparently there sometimes are new edges in just the tile graph?
krame505 Oct 12, 2025
bd3c2fe
Fix how tile stitch points work to consider all children of the prod,…
krame505 Oct 14, 2025
0caf802
Add a utility library for mapping comparable values to unique ids
krame505 Oct 15, 2025
dd37970
More efficient equality and ordering implementation for FlowVertex
krame505 Oct 15, 2025
ce396bc
Fixes for dumping very large flow graphs
krame505 Oct 15, 2025
3f912ae
Fix to uniqueness analysis for sharing in let bindings
krame505 Oct 15, 2025
f89ac50
TODO about unsafeInterleaveIO
krame505 Oct 15, 2025
39dd71e
Use IdCache for more efficient FlowVertex comparison
krame505 Oct 16, 2025
19e2493
Simplify and optimize tile stitch points, just filter through all the…
krame505 Oct 16, 2025
cd2cac6
Just use flowtypes for the boring parts of tree literals, to avoid bl…
krame505 Oct 16, 2025
cc9901a
Avoid checking subterm inh vertex eqs directly, as this is covered in…
krame505 Oct 16, 2025
17591f2
Delete accidentally commited debug print
krame505 Oct 16, 2025
ea21f79
Fix flow errors introduced in earlier commit
krame505 Oct 16, 2025
269702c
Fix dispatch graph sig sharing projection attrs
krame505 Oct 16, 2025
0d94b85
Add stitch points in dispatch graphs for extra children of impl prods
krame505 Oct 16, 2025
c9930aa
Add misc flow type specs
krame505 Oct 22, 2025
3b621ff
Refactor hidden transitive deps check to permit override eqs exported…
krame505 Oct 23, 2025
1c9beec
Fixes to production graph construction
krame505 Oct 23, 2025
271ce3b
Workaround for eq vertex deps not matching my thesis
krame505 Oct 23, 2025
33173bf
Fix test
krame505 Oct 23, 2025
4d3ea4b
Don't complain about excess deps on extra children of impl prods
krame505 Oct 23, 2025
6f7ead3
Disallow extension impl prods that mearly use a forward prod attr to …
krame505 Oct 23, 2025
5a7d6fd
Add cartesian product util function
krame505 Oct 24, 2025
d9631b6
Introduce edges for inh overrides, refactor hidden transitive deps check
krame505 Oct 24, 2025
aa01550
Ensure that eq vertices are distinguished properly
krame505 Oct 24, 2025
7132aca
Distinguish flow deps for outermost node and whole tree construction,…
krame505 Oct 24, 2025
5096343
Fix flow errors
krame505 Oct 25, 2025
b9352c7
Refactor flowTypeVertices -> flowTypeAttrs
krame505 Oct 25, 2025
fb6a61b
Bump up heap size for building the compiler (again)
krame505 Oct 25, 2025
f42ad89
Delete flowTypeName
krame505 Oct 25, 2025
6e0bc11
Merge branch 'feature/dispatch' into feature/stitch-syns
krame505 Oct 27, 2025
ce8b7fb
Add flag to dump graphs for specific productions
krame505 Oct 27, 2025
6678832
Remove old restriction on trans attr overrides in forwarding prods
krame505 Oct 27, 2025
2aa3657
Remove unused isNT from localEq
krame505 Oct 27, 2025
08a8a76
Add foil to Jenkins downstream
krame505 Oct 27, 2025
8512a86
Fix crash in dec site tree resolution due to hidden impl prods in mod…
krame505 Oct 29, 2025
5fea40b
arguments corresponding to sig sharing sites shouldn't have decoratio…
krame505 Oct 29, 2025
4714915
Implement check for cycles due to missing inh override eqs on shared …
krame505 Oct 29, 2025
f908d30
Burninate dispatchDecSites
krame505 Oct 29, 2025
d9e585d
Add flow deps from subtrees eq vertices to their parent eq vertex
krame505 Oct 29, 2025
6c12ce7
Merge branch 'feature/prod-singleton' into feature/stitch-syns
krame505 Oct 30, 2025
9236eac
Make flowTypeEdge just affect the regular forward "syn" vertex
krame505 Oct 30, 2025
bb714dc
Fix bug in decSiteHasInhEq
krame505 Oct 31, 2025
31eea2d
Refactor lhsVertexType_real, forwardVertexType_real now that childles…
krame505 Oct 31, 2025
bd38c37
Introduce seperate vertexes for forward eq/inh/syn, add check and tes…
krame505 Oct 31, 2025
fdd6719
Add utilities for building lists of pairs
krame505 Nov 3, 2025
2d515e0
Use new zipFst/zipSnd utilities
krame505 Nov 3, 2025
bf639f3
Major refactor to FlowVertex and VertexTypes, introduce seperate vert…
krame505 Nov 5, 2025
31f5557
Locally handle eq deps for taking a ref to the LHS, don't project dep…
krame505 Nov 5, 2025
aa9c216
Refactor how outer eq deps are introduced, dec site eq vertices no lo…
krame505 Nov 8, 2025
d482e96
Fix nonterminal stitch points for translation attribute instances
krame505 Nov 9, 2025
d94363b
Major refactor to inh completeness checking
krame505 Dec 1, 2025
bfc86fd
Use subtermVertexType for pattern variables
krame505 Dec 6, 2025
8c98764
Refactoring for better error messages
krame505 Dec 8, 2025
a87e411
Use decoration site trees for checking pattern match scrutinee deps
krame505 Dec 12, 2025
ce9b0eb
Revert unhelpful attempt at making error messages less verbose
krame505 Dec 16, 2025
9b565dd
Fix decoration site tree construction for forward parent and chained …
krame505 Dec 16, 2025
151a671
Fix flow errors found by updated analysis
krame505 Dec 16, 2025
5a7cf3f
Fix cycle in initial build phase by avoiding comparing translations o…
krame505 Dec 21, 2025
fefe73a
Fix inconsistencies in anon vertex "full name" determination
krame505 Dec 21, 2025
54c52fe
Include transitive translation attributes in getInhAndInhOnTransAttrsOn
krame505 Dec 21, 2025
f524e1e
Add hidden transitive deps and dispatch deps exceeds checks for colle…
krame505 Dec 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ melt.trynode('silver') {
// Projects with 'develop' as main branch, we'll try to build specific branch names if they exist
def github_projects = ["/melt-umn/ableC", "/melt-umn/Oberon0", "/melt-umn/meta-ocaml-lite",
"/melt-umn/lambda-calculus", "/melt-umn/rewriting-regex-matching", "/melt-umn/rewriting-optimization-demo",
"/melt-umn/caml-light", "/melt-umn/tree-sharing-demo"]
"/melt-umn/caml-light", "/melt-umn/tree-sharing-demo",
"/melt-umn/foil"]
// These are not currently maintened: "/internal/ring"
// Specific other jobs to build
def specific_jobs = ["/internal/matlab/master"]
Expand Down
2 changes: 1 addition & 1 deletion check-compile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -euo pipefail
BUILDGRAMMAR=${BUILDGRAMMAR:-"silver:compiler:composed:Default"}

export SILVER_HOME=$PWD
JVM_ARGS=(-Xss30M -Xmx6G -jar ../jars/silver.compiler.composed.Default.jar --no-stdlib --dont-translate "$@")
JVM_ARGS=(-Xss30M -Xmx7G -jar ../jars/silver.compiler.composed.Default.jar --no-stdlib --dont-translate "$@")
export GRAMMAR_PATH="../grammars"

mkdir -p build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import silver:compiler:definition:flow:env;
attribute upSubst, downSubst, upSubst2, downSubst2, finalSubst occurs on
Expr, ExprInhs, ExprInh, Exprs, AppExprs, AppExpr, AnnoExpr, AnnoAppExprs;

flowtype Expr = upSubst {forward}, finalType {forward};
flowtype Expr = upSubst {forward}, upSubst2 {forward, downSubst2}, finalType {forward};

propagate upSubst, downSubst
on Expr, ExprInhs, ExprInh, Exprs, AppExprs, AppExpr, AnnoExpr, AnnoAppExprs
Expand Down
28 changes: 21 additions & 7 deletions grammars/silver/compiler/analysis/uniqueness/Expr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ grammar silver:compiler:analysis:uniqueness;

attribute sharedRefs occurs on Expr, Exprs, AppExprs, AppExpr, PrimPatterns, PrimPattern;
propagate sharedRefs on Expr, Exprs, AppExprs, AppExpr, PrimPatterns, PrimPattern
excluding ifThenElse, matchPrimitiveReal, consPattern;
excluding ifThenElse, matchPrimitiveReal, consPattern, letp;

aspect production decorationSiteExpr
top::Expr ::= '@' e::Expr
Expand All @@ -25,9 +25,10 @@ top::Expr ::= '@' e::Expr
top.errors <-
case e.flowVertexInfo of
-- These are errors because we assume these checks in the translation:
| just(lhsVertexType_real()) -> [errFromOrigin(e, s"Cannot share the production LHS.")]
| just(forwardVertexType_real()) -> [errFromOrigin(e, s"Cannot share the forward tree.")]
| just(anonVertexType(_)) -> [errFromOrigin(e, s"Cannot share an anonymously decorated tree.")] -- TODO: I think this works now?
| just(lhsVertexType()) -> [errFromOrigin(e, s"Cannot share the production LHS.")]
| just(forwardVertexType()) -> [errFromOrigin(e, s"Cannot share the forward tree.")]
| just(anonVertexType(_, _, _)) -> [errFromOrigin(e, s"Cannot share an anonymously decorated tree.")] -- TODO: I think this works now?
| just(subtermVertexType(_, _, _)) -> [errFromOrigin(e, s"Cannot share a pattern variable.")] -- Only way this can happen
| just(v) ->
-- Check that this tree is shared in at most one non-mutually-exclusive place.
case lookupSharedRefs(top.frame.fullName, v, top.flowEnv) of
Expand Down Expand Up @@ -68,9 +69,10 @@ top::AppExpr ::= e::Expr
if sigIsShared && isForwardParam then
case e.flowVertexInfo of
-- These are errors because we assume these checks in the translation:
| just(lhsVertexType_real()) -> [errFromOrigin(e, s"Cannot share the production LHS.")]
| just(forwardVertexType_real()) -> [errFromOrigin(e, s"Cannot share the forward tree.")]
| just(anonVertexType(_)) -> [errFromOrigin(e, s"Cannot share an anonymously decorated tree.")] -- TODO: I think this works now?
| just(lhsVertexType()) -> [errFromOrigin(e, s"Cannot share the production LHS.")]
| just(forwardVertexType()) -> [errFromOrigin(e, s"Cannot share the forward tree.")]
| just(anonVertexType(_, _, _)) -> [errFromOrigin(e, s"Cannot share an anonymously decorated tree.")] -- TODO: I think this works now?
| just(subtermVertexType(_, _, _)) -> [errFromOrigin(e, s"Cannot share a pattern variable.")] -- Only way this can happen
| just(v) ->
-- Check that this tree is shared in at most one non-mutually-exclusive place.
case lookupSharedRefs(top.frame.fullName, v, top.flowEnv) of
Expand Down Expand Up @@ -114,3 +116,15 @@ top::PrimPatterns ::= p::PrimPattern _ ps::PrimPatterns
{
top.sharedRefs := unionMutuallyExclusiveRefs(p.sharedRefs, ps.sharedRefs);
}

aspect production letp
top::Expr ::= la::AssignExpr e::Expr
{
top.sharedRefs := e.sharedRefs;
}

aspect production lexicalLocalReference
top::Expr ::= @q::QName _ _ sr::[(String, SharedRefSite)]
{
top.sharedRefs <- sr;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ grammar silver:compiler:analysis:warnings:flow;
-- The flow environment can give us the authoritative list of those attributes to check.
-- These may be from `options` and so requires the flowEnv.

-- TODO: Lots of duplicate warnings here when a projected production exceeds a flow type.
-- Somehow suppress them? Or filter out edges from tile stitch points that exceed a flow type?

aspect production productionDcl
top::AGDcl ::= 'abstract' 'production' id::Name d::ProductionImplements ns::ProductionSignature body::ProductionBody
{
Expand Down Expand Up @@ -40,7 +43,7 @@ function raiseImplicitFwdEqFlowTypes
[Message] ::= config::Decorated CmdArgs lhsNt::String prod::String attr::String e::FlowEnv myGraph::ProductionGraph myFlow::EnvTree<FlowType>
{
-- The actual dependencies for `forward.attr`
local fwdFlowDeps :: set:Set<String> = onlyLhsInh(expandGraph([forwardEqVertex(), forwardSynVertex(attr)], myGraph));
local fwdFlowDeps :: set:Set<String> = onlyLhsInh(expandGraph(forwardVertexType().synDeps(attr), myGraph));
-- The flow type for `attr` on `lhsNt`
local depsForThisAttr :: set:Set<String> = inhDepsForSyn(attr, lhsNt, myFlow);
-- Actual forwards equation deps not in the flow type for `attr`
Expand Down
Loading