Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
racr-mquat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
René Schöne
racr-mquat
Commits
494a0809
Commit
494a0809
authored
9 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Added missing spec.
parent
ee9e6107
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Makefile
+3
-3
3 additions, 3 deletions
Makefile
ast-generation.scm
+2
-2
2 additions, 2 deletions
ast-generation.scm
ilp-measurement.scm
+6
-6
6 additions, 6 deletions
ilp-measurement.scm
ilp-test.scm
+7
-7
7 additions, 7 deletions
ilp-test.scm
mquat.scm
+2
-2
2 additions, 2 deletions
mquat.scm
with
20 additions
and
20 deletions
Makefile
+
3
−
3
View file @
494a0809
...
@@ -13,7 +13,7 @@ LDEPS := $(shell sed -e '1,/@sources:/d' -e '/^\#/d' dependencies.txt | while re
...
@@ -13,7 +13,7 @@ LDEPS := $(shell sed -e '1,/@sources:/d' -e '/^\#/d' dependencies.txt | while re
# larceny builds everytime, so not included in default target
# larceny builds everytime, so not included in default target
all
:
racket
all
:
racket
racket
:
$(RDEPS)
Makefile
racket
:
$(RDEPS)
@
rm
-f
$(
RACKET_BUILD_DIR
)
/mquat/ilp.ss
@
rm
-f
$(
RACKET_BUILD_DIR
)
/mquat/ilp.ss
larceny
:
$(LSRC)
larceny
:
$(LSRC)
...
@@ -21,7 +21,7 @@ larceny: $(LSRC)
...
@@ -21,7 +21,7 @@ larceny: $(LSRC)
@
cp
compile-stale
$(
LARCENY_BUILD_DIR
)
/mquat
@
cp
compile-stale
$(
LARCENY_BUILD_DIR
)
/mquat
@
cd
$(
LARCENY_BUILD_DIR
)
/mquat
&&
larceny
--r6rs
--path
..:
$(
RACR_LARCENY_BIN
)
--program
compile-stale
@
cd
$(
LARCENY_BUILD_DIR
)
/mquat
&&
larceny
--r6rs
--path
..:
$(
RACR_LARCENY_BIN
)
--program
compile-stale
$(RACKET_BUILD_DIR)/mquat/%.ss
:
%.scm
Makefile
$(RACKET_BUILD_DIR)/mquat/%.ss
:
%.scm
@
mkdir
-p
$(
RACKET_BUILD_DIR
)
@
mkdir
-p
$(
RACKET_BUILD_DIR
)
@
rm
-f
$@
@
rm
-f
$@
plt-r6rs ++path
$(
RACR_RACKET_BIN
)
--install
--collections
$(
RACKET_BUILD_DIR
)
$<
plt-r6rs ++path
$(
RACR_RACKET_BIN
)
--install
--collections
$(
RACKET_BUILD_DIR
)
$<
...
@@ -42,4 +42,4 @@ clean:
...
@@ -42,4 +42,4 @@ clean:
rm
-rf
$(
LARCENY_BUILD_DIR
)
/
*
rm
-rf
$(
LARCENY_BUILD_DIR
)
/
*
run
:
racket
run
:
racket
fab call_racket:cli.scm,ag |
tee
ast-output.txt |
head
fab call_racket:cli.scm,ag |
tee
ast-output.txt |
less
This diff is collapsed.
Click to expand it.
ast-generation.scm
+
2
−
2
View file @
494a0809
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
(
lambda
_
val
)))
(
lambda
_
val
)))
(
define
(
something
v
)
v
)
(
define
(
something
v
)
v
)
(
define
(
make-prov
propname
comparator
value
)
(
:ProvClause
mquat-spec
(
:PropertyRef
propname
)
comparator
value
))
(
define
(
make-prov
propname
comparator
value
)
(
:ProvClause
mquat-spec
(
:PropertyRef
mquat-spec
propname
)
comparator
value
))
(
define
(
make-req
propname
comparator
value
)
(
:ReqClause
mquat-spec
(
:PropertyRef
propname
)
comparator
value
))
(
define
(
make-req
propname
comparator
value
)
(
:ReqClause
mquat-spec
(
:PropertyRef
mquat-spec
propname
)
comparator
value
))
; return a proc or #f
; return a proc or #f
(
define
(
create-clause
udfs
default-fun
name
)
(
define
(
create-clause
udfs
default-fun
name
)
...
...
This diff is collapsed.
Click to expand it.
ilp-measurement.scm
+
6
−
6
View file @
494a0809
...
@@ -232,10 +232,10 @@
...
@@ -232,10 +232,10 @@
[
energy
(
find-prop-sw
pn-energy
(
find-create-comp
ast
comp-nr
))]
[
energy
(
find-prop-sw
pn-energy
(
find-create-comp
ast
comp-nr
))]
[
prev-p
(
and
req-comp-nr
(
find-prop-sw
(
node-name
"p"
(
list
req-comp-nr
))
(
find-create-comp
ast
req-comp-nr
)))]
[
prev-p
(
and
req-comp-nr
(
find-prop-sw
(
node-name
"p"
(
list
req-comp-nr
))
(
find-create-comp
ast
req-comp-nr
)))]
[
this-p
(
find-prop-sw
(
node-name
"p"
(
list
comp-nr
))
(
find-create-comp
ast
comp-nr
))]
[
this-p
(
find-prop-sw
(
node-name
"p"
(
list
comp-nr
))
(
find-create-comp
ast
comp-nr
))]
[
clauses
(
filter
(
lambda
(
c
)
c
)
(
list
(
:ReqClause
mquat-spec
(
:PropertyRef
pn-load
)
comp-max-eq
load-f
)
[
clauses
(
filter
(
lambda
(
c
)
c
)
(
list
(
:ReqClause
mquat-spec
(
:PropertyRef
mquat-spec
pn-load
)
comp-max-eq
load-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
pn-energy
)
comp-max-eq
energy-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
mquat-spec
pn-energy
)
comp-max-eq
energy-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
(
->name
this-p
))
comp-max-eq
prov-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
mquat-spec
(
->name
this-p
))
comp-max-eq
prov-f
)
(
and
req-comp-nr
(
:ReqClause
mquat-spec
(
:PropertyRef
(
->name
prev-p
))
comp-max-eq
prev-f
))))]
(
and
req-comp-nr
(
:ReqClause
mquat-spec
(
:PropertyRef
mquat-spec
(
->name
prev-p
))
comp-max-eq
prev-f
))))]
[
new
(
:Mode
mquat-spec
(
node-name
"m"
(
list
mode-nr
impl-nr
comp-nr
))
clauses
)])
[
new
(
:Mode
mquat-spec
(
node-name
"m"
(
list
mode-nr
impl-nr
comp-nr
))
clauses
)])
(
rewrite-add
(
->Mode*
impl
)
new
)
new
))
(
rewrite-add
(
->Mode*
impl
)
new
)
new
))
(
define
(
comp-nr-of
i
)
(
ast-child-index
(
<=comp
i
)))
(
define
(
comp-nr-of
i
)
(
ast-child-index
(
<=comp
i
)))
...
@@ -334,7 +334,7 @@
...
@@ -334,7 +334,7 @@
(
define
(
add-new-resource
)
(
define
(
add-new-resource
)
(
let*
([
max-id
(
apply
max
(
map
(
lambda
(
pe
)
(
string->number
(
substring
(
->name
pe
)
2
)))
(
=every-container
ast
)))]
(
let*
([
max-id
(
apply
max
(
map
(
lambda
(
pe
)
(
string->number
(
substring
(
->name
pe
)
2
)))
(
=every-container
ast
)))]
[
first-clauses
(
->*
(
->ProvClause*
(
car
(
=every-container
ast
))))]
[
first-clauses
(
->*
(
->ProvClause*
(
car
(
=every-container
ast
))))]
[
new-clauses
(
map
(
lambda
(
cl
)
(
make-prov
(
:PropertyRef
(
ast-child
'refname
(
->ReturnType
cl
)))
(
->comparator
cl
)
(
rand
50
2
0
)))
first-clauses
)]
;TODO
[
new-clauses
(
map
(
lambda
(
cl
)
(
make-prov
(
:PropertyRef
mquat-spec
(
ast-child
'refname
(
->ReturnType
cl
)))
(
->comparator
cl
)
(
rand
50
2
0
)))
first-clauses
)]
;TODO
[
new-res
(
:Resource
mquat-spec
(
string-append
"r-"
(
number->string
(
+
1
max-id
)))
rt
online
(
list
)
new-clauses
)])
[
new-res
(
:Resource
mquat-spec
(
string-append
"r-"
(
number->string
(
+
1
max-id
)))
rt
online
(
list
)
new-clauses
)])
(
rewrite-add
(
->SubResources
(
->HWRoot
ast
))
new-res
)))
(
rewrite-add
(
->SubResources
(
->HWRoot
ast
))
new-res
)))
(
define
(
update-change
outer
steps
)
(
define
(
update-change
outer
steps
)
...
@@ -376,7 +376,7 @@
...
@@ -376,7 +376,7 @@
(
define
(
add-new-resource
)
(
define
(
add-new-resource
)
(
let*
([
max-id
(
apply
max
(
map
(
lambda
(
pe
)
(
string->number
(
substring
(
->name
pe
)
2
)))
(
=every-container
ast
)))]
(
let*
([
max-id
(
apply
max
(
map
(
lambda
(
pe
)
(
string->number
(
substring
(
->name
pe
)
2
)))
(
=every-container
ast
)))]
[
first-clauses
(
->*
(
->ProvClause*
(
car
(
=every-container
ast
))))]
[
first-clauses
(
->*
(
->ProvClause*
(
car
(
=every-container
ast
))))]
[
new-clauses
(
map
(
lambda
(
cl
)
(
make-prov
(
:PropertyRef
(
ast-child
'refname
(
->ReturnType
cl
)))
(
->comparator
cl
)
(
rand
50
2
0
)))
first-clauses
)]
;TODO
[
new-clauses
(
map
(
lambda
(
cl
)
(
make-prov
(
:PropertyRef
mquat-spec
(
ast-child
'refname
(
->ReturnType
cl
)))
(
->comparator
cl
)
(
rand
50
2
0
)))
first-clauses
)]
;TODO
[
new-res
(
:Resource
mquat-spec
(
string-append
"r-"
(
number->string
(
+
1
max-id
)))
rt
online
(
list
)
new-clauses
)])
[
new-res
(
:Resource
mquat-spec
(
string-append
"r-"
(
number->string
(
+
1
max-id
)))
rt
online
(
list
)
new-clauses
)])
(
rewrite-add
(
->SubResources
(
->HWRoot
ast
))
new-res
)))
(
rewrite-add
(
->SubResources
(
->HWRoot
ast
))
new-res
)))
(
define
(
update-change
steps
)
(
define
(
update-change
steps
)
...
...
This diff is collapsed.
Click to expand it.
ilp-test.scm
+
7
−
7
View file @
494a0809
...
@@ -636,7 +636,7 @@
...
@@ -636,7 +636,7 @@
(
define
(
add-resource
name
status
prototype
parent
)
(
define
(
add-resource
name
status
prototype
parent
)
(
let*
([
type
(
->type
prototype
)]
(
let*
([
type
(
->type
prototype
)]
[
cs
(
->*
(
->ProvClause*
prototype
))]
[
cs
(
->*
(
->ProvClause*
prototype
))]
[
new-cs
(
map
(
lambda
(
c
)
(
:ProvClause
mquat-spec
(
:PropertyRef
(
ast-child
'refname
(
->ReturnType
c
)))
(
->comparator
c
)
(
->value
c
)))
cs
)])
[
new-cs
(
map
(
lambda
(
c
)
(
:ProvClause
mquat-spec
(
:PropertyRef
mquat-spec
(
ast-child
'refname
(
->ReturnType
c
)))
(
->comparator
c
)
(
->value
c
)))
cs
)])
(
rewrite-add
(
->SubResources
parent
)
(
:Resource
mquat-spec
name
type
status
(
list
)
new-cs
))))
(
rewrite-add
(
->SubResources
parent
)
(
:Resource
mquat-spec
name
type
status
(
list
)
new-cs
))))
; General description: New resources entering the system, enabling new configurations
; General description: New resources entering the system, enabling new configurations
(
let
([
ast
(
create-system
2
0
1
1
2
(
list
#f
no-freq-sw-clauses
no-freq-hw-clauses
#f
))])
(
let
([
ast
(
create-system
2
0
1
1
2
(
list
#f
no-freq-sw-clauses
no-freq-hw-clauses
#f
))])
...
@@ -707,10 +707,10 @@
...
@@ -707,10 +707,10 @@
[
energy
(
find-prop-sw
pn-energy
(
find-create-comp
comp-nr
))]
[
energy
(
find-prop-sw
pn-energy
(
find-create-comp
comp-nr
))]
[
prev-p
(
and
req-comp-nr
(
find-prop-sw
(
node-name
"p"
(
list
req-comp-nr
))
(
find-create-comp
req-comp-nr
)))]
[
prev-p
(
and
req-comp-nr
(
find-prop-sw
(
node-name
"p"
(
list
req-comp-nr
))
(
find-create-comp
req-comp-nr
)))]
[
this-p
(
find-prop-sw
(
node-name
"p"
(
list
comp-nr
))
(
find-create-comp
comp-nr
))]
[
this-p
(
find-prop-sw
(
node-name
"p"
(
list
comp-nr
))
(
find-create-comp
comp-nr
))]
[
clauses
(
filter
(
lambda
(
c
)
c
)
(
list
(
:ReqClause
mquat-spec
(
:PropertyRef
pn-load
)
comp-max-eq
load-f
)
[
clauses
(
filter
(
lambda
(
c
)
c
)
(
list
(
:ReqClause
mquat-spec
(
:PropertyRef
mquat-spec
pn-load
)
comp-max-eq
load-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
pn-energy
)
comp-max-eq
energy-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
mquat-spec
pn-energy
)
comp-max-eq
energy-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
(
->name
this-p
))
comp-max-eq
prov-f
)
(
:ProvClause
mquat-spec
(
:PropertyRef
mquat-spec
(
->name
this-p
))
comp-max-eq
prov-f
)
(
and
req-comp-nr
(
:ReqClause
mquat-spec
(
:PropertyRef
(
->name
prev-p
))
comp-max-eq
prev-f
))))]
(
and
req-comp-nr
(
:ReqClause
mquat-spec
(
:PropertyRef
mquat-spec
(
->name
prev-p
))
comp-max-eq
prev-f
))))]
[
new
(
:Mode
mquat-spec
(
node-name
"m"
(
list
mode-nr
impl-nr
comp-nr
))
clauses
)])
[
new
(
:Mode
mquat-spec
(
node-name
"m"
(
list
mode-nr
impl-nr
comp-nr
))
clauses
)])
(
rewrite-add
(
->Mode*
impl
)
new
)
new
))
(
rewrite-add
(
->Mode*
impl
)
new
)
new
))
(
define
(
prov-obj
val
id
)
(
+
val
(
/
id
1
e3
)))
(
define
(
prov-obj
val
id
)
(
+
val
(
/
id
1
e3
)))
...
@@ -856,9 +856,9 @@
...
@@ -856,9 +856,9 @@
(
for-each
(
lambda
(
cl
)
(
info
"comp"
(
eq?
comp-max-eq
(
->comparator
cl
))
"sub"
(
ast-subtype?
cl
'ReqClause
)
(
for-each
(
lambda
(
cl
)
(
info
"comp"
(
eq?
comp-max-eq
(
->comparator
cl
))
"sub"
(
ast-subtype?
cl
'ReqClause
)
"prop"
(
eq?
p2
(
=real
(
->ReturnType
cl
)))))
(
=every-sw-clause
ast
))
"prop"
(
eq?
p2
(
=real
(
->ReturnType
cl
)))))
(
=every-sw-clause
ast
))
; "clone" req-clauses cls in p1 and change new clauses to target new property
; "clone" req-clauses cls in p1 and change new clauses to target new property
(
for-each
(
lambda
(
cl
)
(
rewrite-add
(
<-
cl
)
(
:ReqClause
mquat-spec
(
:PropertyRef
(
->name
new-p
))
(
->comparator
cl
)
(
->value
cl
))))
req-cls
)
(
for-each
(
lambda
(
cl
)
(
rewrite-add
(
<-
cl
)
(
:ReqClause
mquat-spec
(
:PropertyRef
mquat-spec
(
->name
new-p
))
(
->comparator
cl
)
(
->value
cl
))))
req-cls
)
; "clone" prov-clauses in p2
; "clone" prov-clauses in p2
(
for-each
(
lambda
(
cl
)
(
rewrite-add
(
<-
cl
)
(
:ProvClause
mquat-spec
(
:PropertyRef
(
->name
new-p
))
(
->comparator
cl
)
(
->value
cl
))))
prov-cls
)
(
for-each
(
lambda
(
cl
)
(
rewrite-add
(
<-
cl
)
(
:ProvClause
mquat-spec
(
:PropertyRef
mquat-spec
(
->name
new-p
))
(
->comparator
cl
)
(
->value
cl
))))
prov-cls
)
; adjust values, s.t. one impl fulfills req for first property only, second impl fulfills req for second property only
; adjust values, s.t. one impl fulfills req for first property only, second impl fulfills req for second property only
(
change-sw-req
ast
"p-2"
comp-max-eq
10
"m-1-1-1"
"m-1-2-1"
)
(
change-sw-req
ast
"p-2"
comp-max-eq
10
"m-1-1-1"
"m-1-2-1"
)
(
change-sw-req
ast
"new-p-2"
comp-max-eq
10
"m-1-1-1"
"m-1-2-1"
)
(
change-sw-req
ast
"new-p-2"
comp-max-eq
10
"m-1-1-1"
"m-1-2-1"
)
...
...
This diff is collapsed.
Click to expand it.
mquat.scm
+
2
−
2
View file @
494a0809
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
(
define
(
make-mode
workers
particles
)
(
define
(
make-mode
workers
particles
)
(
:Mode
ms
(
string-append
"KLD-"
(
number->string
workers
)
"-"
(
number->string
particles
))
(
:Mode
ms
(
string-append
"KLD-"
(
number->string
workers
)
"-"
(
number->string
particles
))
(
list
(
:ProvClause
ms
(
:PropertyRef
ms
energy
)
comp-max-eq
(
make-energy-f
workers
particles
))
(
list
(
:ProvClause
ms
(
:PropertyRef
ms
energy
)
comp-max-eq
(
make-energy-f
workers
particles
))
(
:ProvClause
ms
(
:PropertyRef
(
->name
precision
))
comp-min-eq
(
make-precision-f
workers
particles
))
(
:ProvClause
ms
(
:PropertyRef
ms
(
->name
precision
))
comp-min-eq
(
make-precision-f
workers
particles
))
(
:ProvClause
ms
(
:PropertyRef
ms
response-time
)
comp-max-eq
(
make-rt-f
workers
particles
))
(
:ProvClause
ms
(
:PropertyRef
ms
response-time
)
comp-max-eq
(
make-rt-f
workers
particles
))
)))
)))
(
define
modes
(
map
make-mode
(
list
1
1
1
3
3
3
5
5
5
)
(
list
300
500
700
300
500
700
300
500
700
)))
(
define
modes
(
map
make-mode
(
list
1
1
1
3
3
3
5
5
5
)
(
list
300
500
700
300
500
700
300
500
700
)))
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
(
if
(
and
property-value
(
>
0
property-value
))
(
if
(
and
property-value
(
>
0
property-value
))
(
if
clause?
(
rewrite-terminal
'value
clause?
(
lambda
_
property-value
))
; rewrite existing clause
(
if
clause?
(
rewrite-terminal
'value
clause?
(
lambda
_
property-value
))
; rewrite existing clause
; add new clause
; add new clause
(
rewrite-add
(
->Constraints
(
<=request
ast
))
(
:ReqClause
ms
(
:PropertyRef
(
->name
(
=real
property
)))
comparator
(
lambda
_
property-value
))))
(
rewrite-add
(
->Constraints
(
<=request
ast
))
(
:ReqClause
ms
(
:PropertyRef
ms
(
->name
(
=real
property
)))
comparator
(
lambda
_
property-value
))))
(
when
clause?
(
rewrite-delete
clause?
)))))
; delete existing clause
(
when
clause?
(
rewrite-delete
clause?
)))))
; delete existing clause
(
define
(
update-request-objective
objective
)
(
define
(
update-request-objective
objective
)
...
...
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