Finish initial draft of the Alloy article.
This commit is contained in:
@@ -124,7 +124,7 @@ pred possibleState[filterState: FilterState] {
|
||||
// If it's a method receiver, add method or field restriction
|
||||
addBitfieldFlag[bitfieldMiddle, filterState.curFilter, MethodOrField] or
|
||||
// if it's not a receiver, filter to non-methods (could be overridden)
|
||||
addBitfieldFlagNeg[bitfieldMiddle, filterState.curFilter, Method] or
|
||||
// addBitfieldFlagNeg[bitfieldMiddle, filterState.curFilter, Method] or
|
||||
// Maybe methods are not being curFilterd but it's not a receiver, so no change.
|
||||
bitfieldEqual[bitfieldMiddle, filterState.curFilter]
|
||||
}
|
||||
@@ -174,26 +174,29 @@ fact step {
|
||||
}
|
||||
}
|
||||
|
||||
example: run {
|
||||
counterexampleNotFound: run {
|
||||
all searchState: SearchState {
|
||||
// a way that subsequent results of searching it will miss things.
|
||||
eventually some symbol: Symbol, fs: FilterState, fsBroken: FilterState, exclude: Bitfield {
|
||||
// a way that subsequent results of searching will miss things.
|
||||
eventually some symbol: Symbol,
|
||||
fs: FilterState, fsBroken: FilterState,
|
||||
exclude1: Bitfield, exclude2: Bitfield {
|
||||
// Some search (fs) will cause a transition / modification of the search state...
|
||||
possibleState[fs]
|
||||
updateOrSet[searchState.found, fs]
|
||||
excludeBitfield[searchState.found, exclude1]
|
||||
// Such that a later, valid search... (fsBroken)
|
||||
possibleState[fsBroken]
|
||||
excludeBitfield[searchState.found', exclude]
|
||||
excludeBitfield[searchState.found', exclude2]
|
||||
|
||||
// Will allow for a symbol ...
|
||||
// ... that are left out of the original search...
|
||||
not bitfieldMatchesProperties[searchState.found, symbol]
|
||||
// ... and out of the current search
|
||||
not (bitfieldMatchesProperties[fs.curFilter, symbol] and not bitfieldMatchesProperties[searchState.found, symbol])
|
||||
not (bitfieldMatchesProperties[fs.curFilter, symbol] and not bitfieldMatchesProperties[exclude1, symbol])
|
||||
// But would be matched by the broken search...
|
||||
bitfieldMatchesProperties[fsBroken.curFilter, symbol]
|
||||
// ... to not be matched by a search with the new state:
|
||||
not (bitfieldMatchesProperties[fsBroken.curFilter, symbol] and not bitfieldMatchesProperties[exclude, symbol])
|
||||
not (bitfieldMatchesProperties[fsBroken.curFilter, symbol] and not bitfieldMatchesProperties[exclude2, symbol])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user