コード例 #1
0
        public Dictionary <string, Expr> PermissionExprs(Absy absy)
        {
            var domainNameToScope = new Dictionary <string, HashSet <Variable> >();

            foreach (var domainName in linearTypeChecker.linearDomains.Keys)
            {
                domainNameToScope[domainName] = new HashSet <Variable>();
            }

            var availableVars = AvailableLinearLocalVars(absy).Union(LinearGlobalVars());

            foreach (var v in availableVars)
            {
                var domainName = linearTypeChecker.FindDomainName(v);
                domainNameToScope[domainName].Add(MapVariable(v));
            }

            var domainNameToExpr = new Dictionary <string, Expr>();

            foreach (var domainName in domainNameToScope.Keys)
            {
                var permissionExprs =
                    linearTypeChecker.PermissionExprForEachVariable(domainName, domainNameToScope[domainName]);
                domainNameToExpr[domainName] = linearTypeChecker.UnionExprForPermissions(domainName, permissionExprs);
            }

            return(domainNameToExpr);
        }