-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Silly attempt to unify BV lengths via BvSubstitution
- Loading branch information
Showing
6 changed files
with
147 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Class { | ||
#name : #BvSub, | ||
#superclass : #Dictionary, | ||
#category : #SpriteLang | ||
} | ||
|
||
{ #category : #'as yet unclassified' } | ||
BvSub >> subsTy: su [ | ||
^self collect: [ :t | t subsTy: su ] | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
BvSub >> updBvSub: a rtype: t [ | ||
^(t subsBv1: a x: self) copy at: a symbol put: t; yourself | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
Class { | ||
#name : #TAnyBV, | ||
#superclass : #'ΛBase', | ||
#instVars : [ | ||
'symbol' | ||
], | ||
#category : #SpriteLang | ||
} | ||
|
||
{ #category : #'instance creation' } | ||
TAnyBV class >> fresh [ | ||
^self basicNew | ||
obtainFreshSymbol; | ||
yourself | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
TAnyBV class >> symbol: s [ | ||
^self basicNew | ||
symbol: s; | ||
yourself | ||
] | ||
|
||
{ #category : #comparing } | ||
TAnyBV >> = another [ | ||
another class == self class ifFalse: [ ^false ]. | ||
^symbol = another symbol | ||
] | ||
|
||
{ #category : #'refinement typing' } | ||
TAnyBV >> baseSort [ | ||
^Z3Sort uninterpretedSortNamed: 'ANYBV' | ||
] | ||
|
||
{ #category : #comparing } | ||
TAnyBV >> hash [ | ||
^symbol hash | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
TAnyBV >> obtainFreshSymbol [ | ||
symbol := ElabState current freshBvId | ||
] | ||
|
||
{ #category : #printing } | ||
TAnyBV >> printOn: aStream [ | ||
aStream nextPutAll: 'TAnyBV['. | ||
symbol isNil ifFalse: [ aStream nextPutAll: symbol ]. | ||
aStream nextPutAll: ']'. | ||
|
||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
TAnyBV >> symbol [ | ||
^symbol | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
TAnyBV >> symbol: s [ | ||
symbol := s | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
TAnyBV >> unifyBV: t [ | ||
"t is an RType" | ||
(t isKindOf: TBase) ifFalse: [ self shouldBeImplemented ]. | ||
(t b isKindOf: TBitVector) ifTrue: [ t assignBV: self. self halt. ^t ]. | ||
(t b isKindOf: TAnyBV) ifFalse: [ Incompatible signal ]. | ||
|
||
"AnyBV vs AnyBV; there are 4 cases" | ||
symbol isNil | ||
ifTrue: [ | ||
t b symbol isNil | ||
ifTrue: [ ^self shouldBeImplemented ] | ||
ifFalse: [ ^self shouldBeImplemented ] | ||
] ifFalse: [ | ||
t b symbol isNil | ||
ifTrue: [ | t′ | | ||
t′ := TBase b: (TAnyBV symbol: symbol) r: t r. | ||
t′ assignBV: t b. | ||
^t′ | ||
] ifFalse: [ ^self shouldBeImplemented ] | ||
] | ||
] | ||
|
||
{ #category : #'α-renaming' } | ||
TAnyBV >> uniq2: α [ | ||
"Nothing to do" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters