Conditionally defined variables being set to `bad` when undefined

Aperta
#476 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
49/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start from the implementation of variable_define and the handling of conditional variables; the issue does not name source files or tests, so first locate these entry points and reproduce the example with version v0.0.11. Trace why the false branch emits bad and a warning, then check whether the intended behavior is to omit y; done means the behavior matches the clarified expectation and has a regression test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I have a variable that I want to be defined under some conditions but otherwise underfined. For example, I have x as a boolean and y is only defined when x is true.

variable_declare(x,boolDomain,val(bool,true),blah).
variable_define(y,val(string,"A"),variable(x),blah).

This returns (version v0.0.11):

Solving...
Answer: 1 (Time: 0.532s)
warning(variable(badValue),blah,y)
value(x,val(bool,false))
value(y,bad)
Answer: 2 (Time: 0.532s)
value(x,val(bool,true))
value(y,val(string,"A"))
SATISFIABLE

@AbdallahS is this what you intend? I was expecting that when x is false then y should simply not be mention at all, and not that it would produce a bad value with accompanying warning.

Lingua principale
Python
Stelle
4
Fork
0
Merge medio
2g 9h
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di potassco/constraint-handler

Tutte le issue di potassco/constraint-handler

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.