constraint-satisfaction

Unparse AST < O(exp(n))?

落爺英雄遲暮 提交于 2019-12-12 08:23:50
问题 Abstract problem description: The way I see it, unparsing means to create a token stream from an AST, which when parsed again produces an equal AST. So parse(unparse(AST)) = AST holds. This is the equal to finding a valid parse tree which would produce the same AST. The language is described by a context free S-attributed grammar using a eBNF variant. So the unparser has to find a valid 'path' through the traversed nodes in which all grammar constraints hold. This bascially means to find a

Constraint Satisfaction with Uncertainty

别等时光非礼了梦想. 提交于 2019-12-11 06:29:24
问题 I'm trying to solve a problem in which the satisfaction of constraints cannot always be verified. I can find lots of papers on flexible constraint satisfaction, but that's not quite what I want. Here's an example: P(Jim likes Cheese) = 0.8 P(Joe likes Cheese) = 0.5 P(Sam likes Cheese) = 0.2 P(Jim and Sam are friends) = 0.9 P(Jim and Joe are friends) = 0.5 P(Joe and Sam are friends) = 0.7 Charlie is talking about two cheese-liking friends. Who is he most likely talking about? I'm currently

Unparse AST < O(exp(n))?

梦想的初衷 提交于 2019-12-04 01:20:13
Abstract problem description: The way I see it, unparsing means to create a token stream from an AST, which when parsed again produces an equal AST. So parse(unparse(AST)) = AST holds. This is the equal to finding a valid parse tree which would produce the same AST. The language is described by a context free S-attributed grammar using a eBNF variant. So the unparser has to find a valid 'path' through the traversed nodes in which all grammar constraints hold. This bascially means to find a valid allocation of AST nodes to grammar production rules. This is a constraint satisfaction problem (CSP