Skip to content

Commit

Permalink
If we already know it's #===, create PAtom early
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov committed Oct 24, 2024
1 parent f09f5ed commit 9e75b9e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Refinements/Expr.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Expr >> <=> rhs [
{ #category : #'theory symbols' }
Expr >> === rhs [
^ECst
expr: (EMessageSend of: (MessageSend receiver: self selector: #=== argument: rhs))
expr: (PAtom brel: #=== x: self y: rhs)
sort: Bool sort
]

Expand Down
18 changes: 18 additions & 0 deletions src/Refinements/PAtom.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ PAtom >> brel: anObject [
brel := anObject
]

{ #category : #elaboration }
PAtom >> elab: f [
| x′ y′ computed |
brel = Ueq ifTrue: [ self shouldBeImplemented ]. "| r == Ueq || r == Une = do…"
brel = Ueq ifTrue: [ self shouldBeImplemented ].

"elab f@(env,_) (PAtom r e1 e2)"
x′ := (x elab: f) first.
y′ := (y elab: f) first.
computed := x′ perform: brel with: y′.
^{ computed . Bool sort }
]

{ #category : #'term rewriting' }
PAtom >> evaluateIn: aBindEnv ifUndeclared: vndBlock [
^(x evaluateIn: aBindEnv ifUndeclared: vndBlock)
Expand Down Expand Up @@ -97,6 +110,11 @@ PAtom >> printOn: aStream [
aStream nextPut: $).
]

{ #category : #'SMT interface' }
PAtom >> smt2 [
^x smt2 perform: brel with: y smt2
]

{ #category : #'term rewriting' }
PAtom >> subst1: θ [
^PAtom
Expand Down

0 comments on commit 9e75b9e

Please sign in to comment.