Skip to content

Commit

Permalink
[cosmetic] Use typographically-correct selector for #goS′
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov committed Oct 18, 2024
1 parent 4968bbe commit c2251c4
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
24 changes: 12 additions & 12 deletions src/Refinements/CstrAll.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ CstrAll >> doElim: bss var: k [
]

{ #category : #logic }
CstrAll >> goS1: kve _: env _: __ _: be [
CstrAll >> goScope: k [
| pred c1 |
c1 := p.
pred := bind p.
^(pred pKVars includes: k)
ifTrue: [ Either right: self ]
ifFalse: [ c1 goScope: k ]
]

{ #category : #logic }
CstrAll >> goS′: kve _: env _: __ _: be [
"
goS' kve env _ be (H.All b c) = (be'', subcs)
where
Expand All @@ -32,20 +42,10 @@ goS' kve env _ be (H.All b c) = (be'', subcs)
bId := bId_be1 key.
be1 := bId_be1 value.
env1 := env insert: bId.
be2_subcs := p goS1: kve _: env1 _: bSR _: be1.
be2_subcs := p goS′: kve _: env1 _: bSR _: be1.
^be2_subcs
]

{ #category : #logic }
CstrAll >> goScope: k [
| pred c1 |
c1 := p.
pred := bind p.
^(pred pKVars includes: k)
ifTrue: [ Either right: self ]
ifFalse: [ c1 goScope: k ]
]

{ #category : #logic }
CstrAll >> isNNF [
^ self p isNNF
Expand Down
16 changes: 8 additions & 8 deletions src/Refinements/CstrAnd.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ CstrAnd >> flatten [
^CstrAnd of: flatConjuncts
]

{ #category : #logic }
CstrAnd >> goS1: kve _: env _: aSortedReft _: be [
| cs be1_subcss |
cs := self conjuncts.
be1_subcss := cs colject: be into: [ :beSoFar :conjunct | conjunct goS1: kve _: env _: aSortedReft _: beSoFar ].
^be1_subcss key -> be1_subcss value flattened
]

{ #category : #logic }
CstrAnd >> goScope: k [
| scopes rights |
Expand All @@ -73,6 +65,14 @@ CstrAnd >> goScope: k [
^Either right: self "but if kvar appear in multiple chlidren, this is the lca"
]

{ #category : #logic }
CstrAnd >> goS′: kve _: env _: aSortedReft _: be [
| cs be1_subcss |
cs := self conjuncts.
be1_subcss := cs colject: be into: [ :beSoFar :conjunct | conjunct goS′: kve _: env _: aSortedReft _: beSoFar ].
^be1_subcss key -> be1_subcss value flattened
]

{ #category : #logic }
CstrAnd >> isNNF [
^ self conjuncts allSatisfy: [ :conjunct | conjunct isNNF ]
Expand Down
14 changes: 7 additions & 7 deletions src/Refinements/CstrAny.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ Class {
}

{ #category : #logic }
CstrAny >> goS1: kve _: env _: lhs _: be [
CstrAny >> goScope: k [
self shouldNotImplement "any should not appear after poke"
]

{ #category : #logic }
CstrAny >> goS′: kve _: env _: lhs _: be [
| bSR bId_be1 bId be1 env1 be2_subcs be2 subcs |
bSR := HornQuery bindSortedReft_kve: kve bind: bind.
bId_be1 := be insertVar: bind x sort: bSR.
bId := bId_be1 key.
be1 := bId_be1 value.
env1 := env insert: bId.
be2_subcs := p goS1: kve _: env1 _: bSR _: be1.
be2_subcs := p goS′: kve _: env1 _: bSR _: be1.
be2 := be2_subcs key.
subcs := be2_subcs value.
^be2 -> ({ Either left: bId }, subcs)
]

{ #category : #logic }
CstrAny >> goScope: k [
self shouldNotImplement "any should not appear after poke"
]

{ #category : #logic }
CstrAny >> isNNF [
^ false
Expand Down
14 changes: 7 additions & 7 deletions src/Refinements/CstrHead.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ CstrHead >> flatten [
]

{ #category : #'as yet unclassified' }
CstrHead >> goS1: kve _: env _: lhs _: be [
CstrHead >> goScope: k [
((pred isKindOf: RefVarApp) and: [ pred var = k ]) ifTrue: [ ^Either right: self ].
^Either left: #l
]

{ #category : #'as yet unclassified' }
CstrHead >> goS′: kve _: env _: lhs _: be [
| rhs subc |
rhs := lhs updSortedReft_kve: kve p: self pred.
subc := SubC new
Expand All @@ -51,12 +57,6 @@ CstrHead >> goS1: kve _: env _: lhs _: be [
^be -> { Either right: subc }
]

{ #category : #'as yet unclassified' }
CstrHead >> goScope: k [
((pred isKindOf: RefVarApp) and: [ pred var = k ]) ifTrue: [ ^Either right: self ].
^Either left: #l
]

{ #category : #logic }
CstrHead >> isNNF [
^ true
Expand Down
12 changes: 6 additions & 6 deletions src/Refinements/HCstr.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@ HCstr >> flatten [
self subclassResponsibility
]

{ #category : #logic }
HCstr >> goScope: k [
self subclassResponsibility
]

{ #category : #'as yet unclassified' }
HCstr >> goS1: aCollection _: anIBindEnv _: aSortedReft _: aBindEnv [
HCstr >> goS′: aCollection _: anIBindEnv _: aSortedReft _: aBindEnv [
"goS' :: KVEnv a -> F.IBindEnv -> F.SortedReft -> F.BindEnv -> H.Cstr a
-> (F.BindEnv, [Either F.BindId (F.SubC a)])
cf. various forms of goS' in Horn/Info.hs"
self subclassResponsibility
]

{ #category : #logic }
HCstr >> goScope: k [
self subclassResponsibility
]

{ #category : #GT }
HCstr >> gtInspectorShowIn: composite [
<gtInspectorPresentationOrder: 51>
Expand Down
2 changes: 1 addition & 1 deletion src/Refinements/HornQuery.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ goS :: KVEnv a -> F.IBindEnv -> F.SortedReft -> F.BindEnv -> H.Cstr a
-> (F.BindEnv, [F.BindId], [F.SubC a])
"
| be1_ecs mEbs_subcs |
be1_ecs := aCstr goS1: kvEnv _: iBindEnv _: lhs _: aBindEnv.
be1_ecs := aCstr goS′: kvEnv _: iBindEnv _: lhs _: aBindEnv.
mEbs_subcs := be1_ecs value partitionEithers.
^{ be1_ecs key. mEbs_subcs key. mEbs_subcs value. }
]
Expand Down

0 comments on commit c2251c4

Please sign in to comment.