Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rtree
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
chrg
rtree
Commits
a5fdcebd
Commit
a5fdcebd
authored
1 year ago
by
chrg
Browse files
Options
Downloads
Patches
Plain Diff
Add fixpoint mode
parent
41054fe5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rtree-c/bin/Main.hs
+25
-9
25 additions, 9 deletions
rtree-c/bin/Main.hs
with
25 additions
and
9 deletions
rtree-c/bin/Main.hs
+
25
−
9
View file @
a5fdcebd
...
...
@@ -14,6 +14,7 @@ import Control.Monad
import
Control.Monad.IRTree
qualified
as
RPath
import
Control.Monad.State
import
Data.Foldable
import
Data.Function
import
Data.Functor
import
Data.Text
qualified
as
Text
import
Data.Time
(
getCurrentTime
)
...
...
@@ -74,6 +75,14 @@ run = do
,
help
"check every output for validity"
]
fixpoint
<-
flag
False
True
$
fold
[
long
"fixpoint"
,
short
'F'
,
help
"run the computation to a fixpoint"
]
pedandic
<-
flag
False
True
$
fold
...
...
@@ -195,19 +204,26 @@ run = do
liftIO
exitSuccess
l
<-
(
if
expmode
then
IRTree
.
reduceExp
else
IRTree
.
reduce
)
(
check'
file
)
(
ReduceC
.
defaultReduceC
c
)
c
&
fix
\
rec
prevc
->
do
mc'
<-
(
if
expmode
then
IRTree
.
reduceExp
else
IRTree
.
reduce
)
(
check'
file
)
(
ReduceC
.
defaultReduceC
prevc
)
case
mc'
of
Just
c'
->
if
fixpoint
&&
c'
/=
c
then
do
logInfo
"Running again until fixpoint"
rec
c'
else
pure
c'
Nothing
->
do
logError
"Was unable to produce any output"
cleanup
file
when
pedandic
do
liftIO
$
copyFile
file
(
file
<.>
"last"
)
case
l
of
Just
l'
->
output
file
l'
Nothing
->
do
logError
"Was unable to produce any output"
cleanup
file
output
file
l
where
parseCFile
file
=
do
res
<-
liftIO
$
C
.
parseCFilePre
file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment