Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
cloogle.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cloogle
cloogle.org
Commits
2109a575
Verified
Commit
2109a575
authored
Nov 16, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Z3 interface for ranking constraints to Cloogle submodule; prioritise StdEnv over Platform
parent
44b5bb3d
Pipeline
#16499
passed with stage
in 15 minutes and 27 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
44 deletions
+5
-44
backend/Cloogle
backend/Cloogle
+1
-1
backend/CloogleServer.icl
backend/CloogleServer.icl
+3
-43
backend/rank_settings_constraints.json
backend/rank_settings_constraints.json
+1
-0
No files found.
Cloogle
@
9104d2c6
Compare
196fee32
...
9104d2c6
Subproject commit
196fee3253b2e55d09fc990b371d2672a7b79134
Subproject commit
9104d2c68f5b070416cfc816bbacb22510727c99
backend/CloogleServer.icl
View file @
2109a575
...
...
@@ -327,53 +327,13 @@ computeRankConstraints constraintfile db w
#
constraints
=
fromJSON
$
fromString
$
fromOk
f
|
isError
f
||
isNothing
constraints
=
errexit
"Could not open rank settings constraints
\n
"
-1
w
#
constraints
=
fromJust
constraints
#
(
constraints
,
db
)
=
rankConstraints
constraints
db
#
(
z3
,
w
)
=
runProcessIO
"z3"
[
"-in"
]
Nothing
w
|
isError
z3
=
errexit
"Failed to run z3
\n
"
-1
w
#
(
z3h
,
z3io
)
=
fromOk
z3
#
z3input
=
join
"
\n
"
(
constraints
++
[
"(check-sat)"
,
"(get-model)"
,
"(exit)"
])
+++
"
\n
"
#
(
err
,
w
)
=
writePipe
z3input
z3io
.
stdIn
w
|
isError
err
=
errexit
"Failed to write constraints to z3
\n
"
-1
w
#
(
rcode
,
w
)
=
waitForProcess
z3h
w
|
isError
rcode
||
fromOk
rcode
<>
0
=
errexit
(
"z3 failed to compute a model with these constraints:
\n
"
+++
z3input
)
-1
w
#
(
out
,
w
)
=
readPipeBlocking
z3io
.
stdOut
w
|
isError
out
=
errexit
"Failed to read z3 output
\n
"
-1
w
#
out
=
split
"
\n
"
$
fromOk
out
#
settings
=
findSettings
out
{
rs_ngram_distance
=
0.0
,
rs_exact_result
=
0.0
,
rs_record_field
=
0.0
,
rs_constructor
=
0.0
,
rs_unifier_size
=
0.0
,
rs_used_synonyms
=
0.0
,
rs_resolved_context
=
0.0
,
rs_unresolved_context
=
0.0
}
#
(
settings
,
db
,
w
)
=
findRankSettings
constraints
db
w
|
isError
settings
=
errexit
(
fromError
settings
+++
"
\n
"
)
-1
w
#
settings
=
fromOk
settings
#
(
io
,
w
)
=
stdio
w
#
io
=
io
<<<
jsonPrettyPrint
(
toJSON
settings
)
<<<
"
\n
"
#
(_,
w
)
=
fclose
io
w
=
w
where
findSettings
::
![
String
]
!
RankSettings
->
RankSettings
findSettings
[
s
:
v
:
ss
]
rs
|
startsWith
" (define-fun "
s
#
name
=
s
%
(
14
,
size
s
-9
)
// strip off ' (define-fun ' and ' () Real'
#
val
=
toReal
(
v
%
(
4
,
size
v
-2
))
#
rs
=
case
name
of
"rs_ngram_distance"
->
{
rs
&
rs_ngram_distance
=
val
}
"rs_exact_result"
->
{
rs
&
rs_exact_result
=
val
}
"rs_record_field"
->
{
rs
&
rs_record_field
=
val
}
"rs_constructor"
->
{
rs
&
rs_constructor
=
val
}
"rs_unifier_size"
->
{
rs
&
rs_unifier_size
=
val
}
"rs_used_synonyms"
->
{
rs
&
rs_used_synonyms
=
val
}
"rs_resolved_context"
->
{
rs
&
rs_resolved_context
=
val
}
"rs_unresolved_context"
->
{
rs
&
rs_unresolved_context
=
val
}
=
findSettings
ss
rs
findSettings
[
s
:
ss
]
rs
=
findSettings
ss
rs
findSettings
[]
rs
=
rs
::
LogMemory
=
{
mem_ip
::
IPAddress
...
...
backend/rank_settings_constraints.json
View file @
2109a575
...
...
@@ -6,4 +6,5 @@
,
[{
"unify"
:
"(m a) -> a"
},
[
"LT"
,[
"StdList"
,
"last"
],
[
"StdGeneric"
,
"generic_dict"
]]]
,
[{
"unify"
:
"(m a) -> a"
},
[
"LT"
,[
"StdList"
,
"limit"
],
[
"StdGeneric"
,
"generic_dict"
]]]
,
[{
"unify"
:
"(m a) -> a"
},
[
"LT"
,[
"StdOrdList"
,
"minList"
],
[
"StdList"
,
"or"
]]]
,
[{
"unify"
:
"[a] -> a"
},
[
"LT"
,[
"StdList"
,
"last"
],
[
"Data.List"
,
"head"
]]]
]
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