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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
René Schöne
racr-mquat
Commits
79483a51
Commit
79483a51
authored
9 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Comp.selectedimpl is now a real terminal.
parent
2118e055
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ast.scm
+3
-2
3 additions, 2 deletions
ast.scm
basic-ag.scm
+11
-4
11 additions, 4 deletions
basic-ag.scm
ui.scm
+3
-3
3 additions, 3 deletions
ui.scm
with
17 additions
and
9 deletions
ast.scm
+
3
−
2
View file @
79483a51
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
->name
->Property*
->*
<-
<<-
->SubResources
->value
; common
->name
->Property*
->*
<-
<<-
->SubResources
->value
; common
->HWRoot
->SWRoot
; Root
->HWRoot
->SWRoot
; Root
->Comp*
->RealProperty*
; SWRoot
->Comp*
->RealProperty*
; SWRoot
->Impl*
->selected-impl
; Comp
->Impl*
; Comp
->Mode*
->deployed-on
->selected-mode
; Impl
->Mode*
->deployed-on
->selected-mode
; Impl
->Clause*
; Mode
->Clause*
; Mode
->ReturnType
->comparator
; Clause
->ReturnType
->comparator
; Clause
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
(
define
(
->RealProperty*
n
)
(
ast-child
'RealProperty*
n
))
(
define
(
->RealProperty*
n
)
(
ast-child
'RealProperty*
n
))
(
define
(
->name
n
)
(
ast-child
'name
n
))
(
define
(
->name
n
)
(
ast-child
'name
n
))
(
define
(
->Impl*
n
)
(
ast-child
'Impl*
n
))
(
define
(
->Impl*
n
)
(
ast-child
'Impl*
n
))
(
define
(
->selected-impl
n
)
(
ast-child
'selectedimpl
n
))
;
(define (->selected-impl n) (ast-child 'selectedimpl n))
(
define
(
->Property*
n
)
(
ast-child
'Property*
n
))
(
define
(
->Property*
n
)
(
ast-child
'Property*
n
))
(
define
(
->deployed-on
n
)
(
ast-child
'deployedon
n
))
(
define
(
->deployed-on
n
)
(
ast-child
'deployedon
n
))
(
define
(
->selected-mode
n
)
(
ast-child
'selectedmode
n
))
(
define
(
->selected-mode
n
)
(
ast-child
'selectedmode
n
))
...
@@ -77,6 +77,7 @@
...
@@ -77,6 +77,7 @@
(
ast-rule
'Root->HWRoot-SWRoot-Request-config
)
(
ast-rule
'Root->HWRoot-SWRoot-Request-config
)
(
ast-rule
'SWRoot->Comp*-RealProperty*
)
(
ast-rule
'SWRoot->Comp*-RealProperty*
)
; selectedimpl points to a Impl
(
ast-rule
'Comp->name-Impl*-selectedimpl-Property*
)
(
ast-rule
'Comp->name-Impl*-selectedimpl-Property*
)
(
ast-rule
'Impl->name-Mode*-reqcomps-deployedon-selectedmode
)
(
ast-rule
'Impl->name-Mode*-reqcomps-deployedon-selectedmode
)
(
ast-rule
'Mode->name-Clause*
)
(
ast-rule
'Mode->name-Clause*
)
...
...
This diff is collapsed.
Click to expand it.
basic-ag.scm
+
11
−
4
View file @
79483a51
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
(
define
(
<=request
n
)
(
att-value
'get-request
n
))
(
define
(
<=request
n
)
(
att-value
'get-request
n
))
(
define
(
=real
n
)
(
att-value
'real
n
))
(
define
(
=real
n
)
(
att-value
'real
n
))
(
define
(
<=root
n
)
(
att-value
'get-root
n
))
(
define
(
<=root
n
)
(
att-value
'get-root
n
))
(
define
(
=selected-impl
n
)
(
att-value
'selected-impl
n
))
(
define
(
=selected?
n
)
(
att-value
'selected?
n
))
(
define
(
=selected?
n
)
(
att-value
'selected?
n
))
(
define
=target
(
define
=target
(
case-lambda
[(
n
name
)
(
att-value
'target
n
name
)]
(
case-lambda
[(
n
name
)
(
att-value
'target
n
name
)]
...
@@ -89,7 +90,7 @@
...
@@ -89,7 +90,7 @@
; hw → search in deployedon for name and type
; hw → search in deployedon for name and type
(
=provided-clause
(
->deployed-on
(
<=impl
n
))
propName
target
)
(
=provided-clause
(
->deployed-on
(
<=impl
n
))
propName
target
)
; sw → search in target-component
; sw → search in target-component
(
=provided-clause
(
=mode-to-use
(
->
selected-impl
target
))
propName
)))
(
=provided-clause
(
=mode-to-use
(
=
selected-impl
target
))
propName
)))
(
->MetaParameter*
(
<=request
n
))))))
; Params from request, applied to the value function
(
->MetaParameter*
(
<=request
n
))))))
; Params from request, applied to the value function
(
ProvClause
(
lambda
(
n
)
(
=eval
n
))))
(
ProvClause
(
lambda
(
n
)
(
=eval
n
))))
...
@@ -100,7 +101,7 @@
...
@@ -100,7 +101,7 @@
(
ag-rule
(
ag-rule
clauses-met?
clauses-met?
(
Root
(
lambda
(
n
)
(
and
(
=clauses-met?
(
<=request
n
))
(
for-all
=clauses-met?
(
->*
(
->Comp*
(
->SWRoot
n
)))))))
(
Root
(
lambda
(
n
)
(
and
(
=clauses-met?
(
<=request
n
))
(
for-all
=clauses-met?
(
->*
(
->Comp*
(
->SWRoot
n
)))))))
(
Comp
(
lambda
(
n
)
(
=clauses-met?
(
->
selected-impl
n
))))
(
Comp
(
lambda
(
n
)
(
=clauses-met?
(
=
selected-impl
n
))))
(
Impl
(
lambda
(
n
)
(
=clauses-met?
(
=mode-to-use
n
))))
(
Impl
(
lambda
(
n
)
(
=clauses-met?
(
=mode-to-use
n
))))
(
Mode
(
lambda
(
n
)
(
for-all
=clauses-met?
(
->*
(
->Clause*
n
)))))
(
Mode
(
lambda
(
n
)
(
for-all
=clauses-met?
(
->*
(
->Clause*
n
)))))
(
ReqClause
(
lambda
(
n
)
((
comp->f
(
->comparator
n
))
(
=eval
n
)
(
=actual-value
n
))))
(
ReqClause
(
lambda
(
n
)
((
comp->f
(
->comparator
n
))
(
=eval
n
)
(
=actual-value
n
))))
...
@@ -225,7 +226,7 @@
...
@@ -225,7 +226,7 @@
objective-value
objective-value
(
Root
(
lambda
(
n
)
(
=objective-val
(
->SWRoot
n
))))
(
Root
(
lambda
(
n
)
(
=objective-val
(
->SWRoot
n
))))
(
SWRoot
(
lambda
(
n
)
(
fold-left
(
lambda
(
total
comp
)
(
+
total
(
=objective-val
comp
)))
0
(
->*
(
->Comp*
(
->SWRoot
n
))))))
(
SWRoot
(
lambda
(
n
)
(
fold-left
(
lambda
(
total
comp
)
(
+
total
(
=objective-val
comp
)))
0
(
->*
(
->Comp*
(
->SWRoot
n
))))))
(
Comp
(
lambda
(
n
)
(
=objective-val
(
->
selected-impl
n
))))
(
Comp
(
lambda
(
n
)
(
=objective-val
(
=
selected-impl
n
))))
(
Impl
(
lambda
(
n
)
(
=objective-val
(
=mode-to-use
n
))))
(
Impl
(
lambda
(
n
)
(
=objective-val
(
=mode-to-use
n
))))
(
Mode
(
lambda
(
n
)
(
=eval
(
=provided-clause
n
(
=objective-name
n
))))))
(
Mode
(
lambda
(
n
)
(
=eval
(
=provided-clause
n
(
=objective-name
n
))))))
...
@@ -319,8 +320,14 @@
...
@@ -319,8 +320,14 @@
(
Resource
(
lambda
(
n
name
)
(
or
(
string=?
(
->name
n
)
name
)
(
ast-find-child
(
lambda
(
i
pe
)
(
=search-pe
pe
name
))
(
Resource
(
lambda
(
n
name
)
(
or
(
string=?
(
->name
n
)
name
)
(
ast-find-child
(
lambda
(
i
pe
)
(
=search-pe
pe
name
))
(
->SubResources
n
))))))
(
->SubResources
n
))))))
; =selected-impl: Resolves the selected implementation of a component
(
ag-rule
selected-impl
(
Comp
(
lambda
(
n
)
(
let
([
si
(
ast-child
'selectedimpl
n
)])
(
and
si
(
ast-find-child
(
lambda
(
j
i
)
(
string=?
si
(
->name
i
)))
(
->Impl*
n
)))))))
; =selected?: Returns #t, if the Implementation is selected by its component
; =selected?: Returns #t, if the Implementation is selected by its component
(
ag-rule
selected?
(
Impl
(
lambda
(
n
)
(
eq?
(
->
selected-impl
(
<<-
n
))
n
))))
(
ag-rule
selected?
(
Impl
(
lambda
(
n
)
(
eq?
(
=
selected-impl
(
<<-
n
))
n
))))
; [DEBUGGING] Returns whether the ResourceType, the Resource is pointing to, is a container
; [DEBUGGING] Returns whether the ResourceType, the Resource is pointing to, is a container
(
ag-rule
remote-container
(
Resource
(
lambda
(
n
)
(
->container?
(
=type
n
)))))
(
ag-rule
remote-container
(
Resource
(
lambda
(
n
)
(
->container?
(
=type
n
)))))
...
...
This diff is collapsed.
Click to expand it.
ui.scm
+
3
−
3
View file @
79483a51
...
@@ -87,10 +87,10 @@
...
@@ -87,10 +87,10 @@
; Given a component (or an impl) and a resource, change deployed-on of the selected impl
; Given a component (or an impl) and a resource, change deployed-on of the selected impl
; of the given component (or the given impl) to the given resource, returning the old resource
; of the given component (or the given impl) to the given resource, returning the old resource
(
define
(
deploy-on
x
new-pe
)
(
rewrite-terminal
'deployedon
(
if
(
ast-subtype?
x
'Comp
)
(
->
selected-impl
x
)
x
)
new-pe
))
(
define
(
deploy-on
x
new-pe
)
(
rewrite-terminal
'deployedon
(
if
(
ast-subtype?
x
'Comp
)
(
=
selected-impl
x
)
x
)
new-pe
))
(
define
(
use-next-impl
comp
)
(
define
(
use-next-impl
comp
)
(
let*
([
former-impl
(
->
selected-impl
comp
)]
(
let*
([
former-impl
(
=
selected-impl
comp
)]
[
former-index
(
ast-child-index
former-impl
)]
[
former-index
(
ast-child-index
former-impl
)]
[
num-impls
(
ast-num-children
(
->Impl*
comp
))]
[
num-impls
(
ast-num-children
(
->Impl*
comp
))]
[
former-deployed
(
->deployed-on
former-impl
)]
[
former-deployed
(
->deployed-on
former-impl
)]
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
[
first-new-mode
(
car
(
->*
(
->Mode*
new-impl
)))])
[
first-new-mode
(
car
(
->*
(
->Mode*
new-impl
)))])
(
rewrite-terminal
'deployedon
former-impl
#f
)
(
rewrite-terminal
'deployedon
former-impl
#f
)
(
rewrite-terminal
'selectedmode
former-impl
#f
)
(
rewrite-terminal
'selectedmode
former-impl
#f
)
(
rewrite-terminal
'selectedimpl
comp
new-impl
)
(
rewrite-terminal
'selectedimpl
comp
(
->name
new-impl
)
)
(
rewrite-terminal
'deployedon
new-impl
former-deployed
)
(
rewrite-terminal
'deployedon
new-impl
former-deployed
)
(
rewrite-terminal
'selectedmode
new-impl
first-new-mode
)
; use first mode
(
rewrite-terminal
'selectedmode
new-impl
first-new-mode
)
; use first mode
new-impl
))
new-impl
))
...
...
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