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
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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cloogle
Cloogle
Commits
a41eaffb
Verified
Commit
a41eaffb
authored
Nov 17, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let Z3 output decimals instead of fractions (easier to parse)
parent
d7b379e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Cloogle/Search/Rank.dcl
Cloogle/Search/Rank.dcl
+1
-1
Cloogle/Search/Rank.icl
Cloogle/Search/Rank.icl
+3
-3
libcloogle
libcloogle
+1
-1
No files found.
Cloogle/Search/Rank.dcl
View file @
a41eaffb
...
@@ -34,7 +34,7 @@ from Cloogle.DB import :: Annotation, :: CloogleEntry, :: CloogleDB
...
@@ -34,7 +34,7 @@ from Cloogle.DB import :: Annotation, :: CloogleEntry, :: CloogleDB
*/
*/
::
RankInformation
:==
RankSettings
::
RankInformation
:==
RankSettings
distance
::
!
RankSettings
!
CloogleEntry
![
Annotation
]
->
Int
distance
::
!
RankSettings
!
CloogleEntry
![
Annotation
]
->
Real
symbolicDistance
::
!
CloogleEntry
![
Annotation
]
->
RankInformation
symbolicDistance
::
!
CloogleEntry
![
Annotation
]
->
RankInformation
...
...
Cloogle/Search/Rank.icl
View file @
a41eaffb
...
@@ -24,8 +24,8 @@ import Cloogle.API
...
@@ -24,8 +24,8 @@ import Cloogle.API
import
Cloogle
.
DB
import
Cloogle
.
DB
import
Cloogle
.
Search
import
Cloogle
.
Search
distance
::
!
RankSettings
!
CloogleEntry
![
Annotation
]
->
Int
distance
::
!
RankSettings
!
CloogleEntry
![
Annotation
]
->
Real
distance
settings
entry
annots
=
let
info
=
symbolicDistance
entry
annots
in
toInt
$
distance
settings
entry
annots
=
let
info
=
symbolicDistance
entry
annots
in
settings
.
rs_ngram_distance
*
info
.
rs_ngram_distance
+
settings
.
rs_ngram_distance
*
info
.
rs_ngram_distance
+
settings
.
rs_exact_result
*
info
.
rs_exact_result
+
settings
.
rs_exact_result
*
info
.
rs_exact_result
+
settings
.
rs_record_field
*
info
.
rs_record_field
+
settings
.
rs_record_field
*
info
.
rs_record_field
+
...
@@ -109,7 +109,7 @@ findRankSettings constraints cdb w
...
@@ -109,7 +109,7 @@ findRankSettings constraints cdb w
#
(
z3
,
w
)
=
runProcessIO
"z3"
[
"-in"
]
Nothing
w
#
(
z3
,
w
)
=
runProcessIO
"z3"
[
"-in"
]
Nothing
w
|
isError
z3
=
(
Error
"Failed to run z3"
,
cdb
,
w
)
|
isError
z3
=
(
Error
"Failed to run z3"
,
cdb
,
w
)
#
(
z3h
,
z3io
)
=
fromOk
z3
#
(
z3h
,
z3io
)
=
fromOk
z3
#
z3input
=
join
"
\n
"
(
constraints
++
[
"(check-sat)"
,
"(get-model)"
,
"(exit)"
])
+++
"
\n
"
#
z3input
=
join
"
\n
"
(
constraints
++
[
"(
set-option :pp.decimal true)"
,
"(
check-sat)"
,
"(get-model)"
,
"(exit)"
])
+++
"
\n
"
#
(
err
,
w
)
=
writePipe
z3input
z3io
.
stdIn
w
#
(
err
,
w
)
=
writePipe
z3input
z3io
.
stdIn
w
|
isError
err
=
(
Error
"Failed to write constraints to z3"
,
cdb
,
w
)
|
isError
err
=
(
Error
"Failed to write constraints to z3"
,
cdb
,
w
)
#
(
rcode
,
w
)
=
waitForProcess
z3h
w
#
(
rcode
,
w
)
=
waitForProcess
z3h
w
...
...
libcloogle
@
6379c202
Compare
49a6c636
...
6379c202
Subproject commit
49a6c636f3888f129807cd2b9d1a9cfe53e44bfd
Subproject commit
6379c20283a97f37fb76b44dc7869869f0f32065
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