Sunday, 15 January 2012

alloy - Keywords: some and one before higher-order quantification -



alloy - Keywords: some and one before higher-order quantification -

i have alloy specification representing model transformation rules.. in specification, utilize higher-order quantification specify rule matching. 1 unusual thing analyzer works differently "some" , "one", cannot understand.

for example, in pred rule_enter[trans:trans](see line 240), utilize 2 higher-order quantification encoding matching of left , right side of graph transformation rule. *********************example**************************************

some e_check0:acheck&trans.darrows, e_tp0:atp&(trans.source.arrows-trans.darrows), e_pf10:apf1&trans.darrows, e_tr0:atr&(trans.source.arrows-trans.darrows), e_f1r0:af1r&trans.darrows | allow n_p0 = e_check0.src, n_t0 = e_tp0.src, n_r0 = e_tr0.trg, n_f10 = e_pf10.trg | (n_p0 = e_check0.trg , n_p0 = e_tp0.trg , n_p0 = e_pf10.src , n_t0 = e_tr0.src , n_f10 = e_f1r0.src , n_r0 = e_f1r0.trg , n_f10 in nf1&trans.dnodes , n_p0 in np&(trans.source.nodes-trans.dnodes) , n_t0 in nt&(trans.source.nodes-trans.dnodes) , n_r0 in nr&(trans.source.nodes-trans.dnodes)) e_crit0:acrit&trans.aarrows, e_tp0:atp&(trans.source.arrows-trans.darrows), e_pf20:apf2&trans.aarrows, e_tr0:atr&(trans.source.arrows-trans.darrows), e_f2r0:af2r&trans.aarrows | allow n_p0 = e_crit0.src, n_t0 = e_tp0.src, n_r0 = e_tr0.trg, n_f20 = e_pf20.trg | (n_p0 = e_crit0.trg , n_p0 = e_tp0.trg , n_p0 = e_pf20.src , n_t0 = e_tr0.src , n_f20 = e_f2r0.src , n_r0 = e_f2r0.trg , n_f20 in nf2&trans.anodes , n_p0 in np&(trans.source.nodes-trans.dnodes) , n_t0 in nt&(trans.source.nodes-trans.dnodes) , n_r0 in nr&(trans.source.nodes-trans.dnodes))

here utilize keyword "some". analyzer can work scope 10.

but if utilize keyword "one", analyzer reports next error scope 5: *********************example**************************************

executing "check check$1 5 1 trans, 2 graph, 1 rule" solver=minisat(jni) bitwidth=0 maxseq=0 skolemdepth=1 symmetry=20 generating cnf... . translation capacity exceeded. in scope, universe contains 89 atoms , relations of arity 5 cannot represented. visit http://alloy.mit.edu/ advice on refactoring.

my question why 2 quantification have different performances?

one in alloy encoded using set comprehension , cardinality operator, e.g.,

one s: s | p[s]

is transformed to

#{s: s | p[s]} = 1

set comprehension cannot skolemized, when quantifier in question higher-order, alloy gives up.

alloy

No comments:

Post a Comment