Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
sturdy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLMZ
sturdy
Commits
11c79d36
Unverified
Commit
11c79d36
authored
Jan 31, 2019
by
Sven Keidel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix fixpoint algo
parent
03b3c623
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
lib/src/Control/Arrow/Transformer/Abstract/Fixpoint.hs
lib/src/Control/Arrow/Transformer/Abstract/Fixpoint.hs
+3
-3
lib/src/Control/Arrow/Utils.hs
lib/src/Control/Arrow/Utils.hs
+3
-6
lib/src/Data/Abstract/Map.hs
lib/src/Data/Abstract/Map.hs
+3
-2
No files found.
lib/src/Control/Arrow/Transformer/Abstract/Fixpoint.hs
View file @
11c79d36
...
...
@@ -117,9 +117,9 @@ memoize (FixT f) = FixT $ \(stackWidening,widening) -> proc (((stack,oldCache),
-- cache with previous knowledge about the result or ⊥, compute
-- the result of the function and update the fixpoint cache.
Nothing
->
do
let
yOld
=
fromMaybe
bottom
(
M
.
unsafeLookup
x
oldCache
)
newCache'
=
M
.
insert
x
yOld
newCache
(
x'
,
stack'
)
=
runState
(
stackWidening
x
)
stack
let
(
x'
,
stack'
)
=
runState
(
stackWidening
x
)
stack
yOld
=
fromMaybe
bottom
(
M
.
unsafeLookup
x'
oldCache
)
newCache'
=
M
.
insert
x'
yOld
newCache
(
newCache''
,
y
)
<-
f
(
stackWidening
,
widening
)
-<
(((
stack'
,
oldCache
),
newCache'
),
x'
)
let
newCache'''
=
M
.
unsafeInsertWith
(
flip
(
T
.
widening
widening
))
x'
y
newCache''
y'
=
fromJust
(
M
.
unsafeLookup
x'
newCache'''
)
...
...
lib/src/Control/Arrow/Utils.hs
View file @
11c79d36
...
...
@@ -36,12 +36,9 @@ pi2 = arr snd
-- | Zips two lists together.
zipWith
::
ArrowChoice
c
=>
c
(
x
,
y
)
z
->
c
([
x
],[
y
])
[
z
]
zipWith
f
=
proc
(
l1
,
l2
)
->
case
(
l1
,
l2
)
of
(
[]
,
_
)
->
returnA
-<
[]
(
_
,
[]
)
->
returnA
-<
[]
(
a
:
as
,
b
:
bs
)
->
do
c
<-
f
-<
(
a
,
b
)
cs
<-
zipWith
f
-<
(
as
,
bs
)
returnA
-<
c
:
cs
(
[]
,
_
)
->
returnA
-<
[]
(
_
,
[]
)
->
returnA
-<
[]
(
a
:
as
,
b
:
bs
)
->
uncurry
(
:
)
^<<
f
***
zipWith
f
-<
((
a
,
b
),(
as
,
bs
))
-- | Folds a computation over a list from left to right.
fold
::
ArrowChoice
c
=>
c
(
a
,
x
)
a
->
c
([
x
],
a
)
a
...
...
lib/src/Data/Abstract/Map.hs
View file @
11c79d36
...
...
@@ -10,8 +10,8 @@ import Prelude hiding (lookup,map,Either(..),(**))
import
Control.Arrow
import
Data.HashMap.
Strict
(
HashMap
)
import
qualified
Data.HashMap.
Strict
as
H
import
Data.HashMap.
Lazy
(
HashMap
)
import
qualified
Data.HashMap.
Lazy
as
H
import
Data.Hashable
import
Data.Order
import
Data.Identifiable
...
...
@@ -47,6 +47,7 @@ widening w (Map m1) (Map m2) = Map $ H.map join $ H.unionWith (E.widening (finit
Left
(
_
,
a
)
->
(
May
,
a
)
Right
(
_
,
b
)
->
(
May
,
b
)
LeftRight
(
t1
,
a
)
(
t2
,
b
)
->
(
t1
⊔
t2
,
a
`
w
`
b
)
{-# INLINE widening #-}
{-# SCC widening #-}
instance
(
Identifiable
a
,
PreOrd
b
)
=>
LowerBounded
(
Map
a
b
)
where
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment