sv_chercher_eg.miaou
← Le code · src/outil/miaou/sv_chercher_eg.miaou · 48 lignes
(node sv_chercher_eg
(params (l (Liste Ct)) (i Nat))
(returns Ue)
(intent "la première égalité de l (son rang, compté depuis i) qui a un coefficient 1 ou -1 : sa variable, ce coefficient et son polynôme, comme la recherche de q_gauss de l'outil inter")
(origin "phase 8f6 : notre solveur en miaou, d'après le solveur (q_…) de l'outil inter")
(effects)
(uses sv_unitaire)
(requires
true)
(ensures
true)
(decreases l)
(examples
(ex ((list (record Ct (k 0) (p (record Po (k (record Grand (neg true) (mots (list 5)))) (ts (list (record Tm (v 0) (c (record Grand (neg false) (mots (list 1)))))))))) (record Ct (k 1) (p (record Po (k (record Grand (neg true) (mots (list 5)))) (ts (list (record Tm (v 0) (c (record Grand (neg false) (mots (list 2))))) (record Tm (v 1) (c (record Grand (neg true) (mots (list 1))))))))))) 0)
(record Ue
(trouve true)
(k 1)
(v 1)
(a (record Grand (neg true) (mots (list 1))))
(e (record Po (k (record Grand (neg true) (mots (list 5)))) (ts (list (record Tm (v 0) (c (record Grand (neg false) (mots (list 2))))) (record Tm (v 1) (c (record Grand (neg true) (mots (list 1)))))))))))
(ex ((list (record Ct (k 0) (p (record Po (k (record Grand (neg true) (mots (list 5)))) (ts (list (record Tm (v 0) (c (record Grand (neg false) (mots (list 1))))))))))) 0)
(record Ue
(trouve false)
(k 0)
(v 0)
(a (record Grand (neg false) (mots (list))))
(e (record Po (k (record Grand (neg false) (mots (list)))) (ts (list)))))))
(equivalence exact)
(body.high
(match l
(case empty
()
(record Ue
(trouve false)
(k 0)
(v 0)
(a (record Grand (neg false) (mots (list))))
(e (record Po (k (record Grand (neg false) (mots (list)))) (ts (list))))))
(case cons
(c r)
(if (eq (get c k) 1)
(match (sv_unitaire (get (get c p) ts))
(case cons
(t autres)
(record Ue (trouve true) (k i) (v (get t v)) (a (get t c)) (e (get c p))))
(case empty () (sv_chercher_eg r (add i 1))))
(sv_chercher_eg r (add i 1))))))
(end node sv_chercher_eg))