Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select best function design #26

Open
Rezenders opened this issue Dec 9, 2024 · 1 comment
Open

Select best function design #26

Rezenders opened this issue Dec 9, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@Rezenders
Copy link
Member

I am having a hard time trying to modify the SUAVE PDDL formulation to select the best function design available.

So far, I have something like the following:

(:derived (inferred-performance_value ?fd ?value)
    (and
      (exists (?eqa)
        (and
          (hasQAestimation ?fd ?eqa)
          (isQAtype ?eqa performance)
          (hasValue ?eqa ?value)
        )
      )
    )
  )

  (:derived (inferred-better_performance ?f ?fd_best ?fd)
    (and
      (FunctionDesign ?fd_best)
      (FunctionDesign ?fd)
      (solvesF ?fd_best ?f)
      (solvesF ?fd ?f)
      (exists (?value_best ?value - owl-number)
        (and
          (inferred-performance_value ?fd_best ?value_best)
          (inferred-performance_value ?fd ?value)
          (lessThan ?value ?value_best)
        )
      )
    )
  )

(:action reconfigure
    :parameters (?f ?fd_initial ?fd_goal)
    :precondition (and
      (Function ?f)
      (FunctionDesign ?fd_initial)
      (FunctionDesign ?fd_goal)
      (system_in_mode ?f ?fd_initial)
      (not (= ?fd_initial ?fd_goal))
      (solvesF ?fd_goal ?f)
      (forall (?fd)
        (imply
          (and (FunctionDesign ?fd) (solvesF ?fd ?f) (not (= ?fd_goal ?fd)) (not (inferred-Fd_realisability ?fd false_boolean)))
          (inferred-better_performance ?f ?fd_goal ?fd)
        )
      )
    )
    :effect (and
      (not (system_in_mode ?f ?fd_initial))
      (system_in_mode ?f ?fd_goal)
    )
  )

This formulation doesn't work, and I am not sure why.
In addition, PlanSys doesn't support forall and imply so the final solution shouldn't contain both.
Perhaps it is easier to define a SWRL rule for this instead of defining it in PDDL

@Rezenders Rezenders added the help wanted Extra attention is needed label Dec 9, 2024
@Rezenders Rezenders reopened this Dec 9, 2024
@tobiaswjohn
Copy link
Collaborator

  • one should be able to model forall as
not(
   exists (?fd) (not (
      ...
   ))
)
  • one should be able to model imply( X Y ) as (or (not X) Y)
  • but I think a SWRL rule and some modifications to the PDDL might be better suited. I don't think, we can encode everything in SWRL because of how negations work in OWL. But we can have a SWRL rule for better_performance such as:
FunctionDesign(?fd) ^ FunctionDesign(?fd_better) ^ Function(?f) ^ solvesF(?fd, ?f) ^ solvesF(?fd_better, ?f) ^ performanceValue(?fd, ?x) ^ performanceValue(?fd_better, ?x_better) ^ lessThan(?x, ?x_better) -> betterPerformance(?fd_better, ?fd)

(I dropped the function from the relation as solvesF is functional anyway and it is therefore redundant)
this can than be used in PDDL, where one checks that there is no better functional design that is realisable (syntax might be slightly off...):

(:action reconfigure
    :parameters (?f ?fd_initial ?fd_goal)
    :precondition (and
      (Function ?f)
      (FunctionDesign ?fd_initial)
      (FunctionDesign ?fd_goal)
      (system_in_mode ?f ?fd_initial)
      (not (= ?fd_initial ?fd_goal))
      (solvesF ?fd_goal ?f)
      (not (exists (?fd)
          (not (inferred-Fd_realisability ?fd false_boolean)))
          (inferred-better_performance ?fd ?fd_goal)
        )
      )
    )
    :effect (and
      (not (system_in_mode ?f ?fd_initial))
      (system_in_mode ?f ?fd_goal)
    )
  )

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants