Subversion Repositories wimsdev

Rev

Rev 16209 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!set methtit=Simple déduction d'inégalité
2
!set methenv=ZZ QQ RR
3
!set methparmtype=parm inequality >,\
4
	parm inequality <,choice 3,\
5
	function,choice 4,function
6
!set methparmrelax=1,2,3
7
!set methhelp=Cette méthode permet d'établir une implication entre deux\
16209 bpr 8
  inégalités. Cette implication peut se déduire par une composition\
9
  d'addition de termes, de \
10
  transitivité avec une inégalité évidente, de déduction entre inégalités\
11
  strictes et non-strictes, et de multiplication\
12
  des deux côtés d'une inégalité par une constante.\
13
  Par exemple, elle reconnait <p class="wimscenter">\
20 reyssat 14
   \( 2*x > -2 => -4*x < 10 - x ) .\
16209 bpr 15
  </p>\
16
  Vous pouvez utiliser cette méthode soit pour affaiblir une inégalité dans\
17
  les hypothèses, soit pour renforcer une inégalité dans le but.
20 reyssat 18
 
19
!if $wims_read_parm iswordof form check
16117 bpr 20
  !goto $wims_read_parm
20 reyssat 21
!endif
22
 
23
!set obj=!exec mathexp extract inequality\
24
$objects
25
!if $obj=$empty
16117 bpr 26
  !set error1=no_object
27
  !set penalty1=1
28
  !exit
20 reyssat 29
!endif
11567 bpr 30
 
20 reyssat 31
!exit
32
:form
16117 bpr 33
!set n1=!linecnt $mtobj1
34
!set n2=!linecnt $mtobj2
35
!if $methsubstep=1
20 reyssat 36
  !if $n1<1
16117 bpr 37
    !set methparm3=2
38
    !goto goal
20 reyssat 39
  !endif
40
  !if $n2<1
16117 bpr 41
    !set methparm3=1
42
    !goto ctx
20 reyssat 43
  !endif
44
  :opt
45
  <b>$methtit.</b>
46
  $methhelp
47
  <p>
48
  Vous voulez&nbsp;:
49
  !formselect methparm3 list 0,1,2,3 prompt $ch_choose,\
16117 bpr 50
	  affaiblir une inégalité dans l'hypothèse,\
51
	  renforcer une inégalité du but,\
52
	  une hypothèse implique un but
20 reyssat 53
  !set methsubstep=2
16117 bpr 54
!else
20 reyssat 55
  !bound methparm3 between integer 0 and 3 default 0
56
  !if $methparm3=0
16117 bpr 57
    !goto opt
20 reyssat 58
  !endif
59
  !if $methparm3 iswordof 1 3
16117 bpr 60
    :ctx
61
    !set methparmrelax=2,3
62
    L'inégalité
63
    !read deduc/methparm.phtml 1
64
    implique
20 reyssat 65
  !else
16117 bpr 66
    :goal
67
    !set methparmrelax=1,3
68
    Pour montrer
69
    !read deduc/methparm.phtml 2
70
    , il suffit de montrer
11567 bpr 71
  !endif
17187 bpr 72
  <br>
20 reyssat 73
  !if $methparm3<3
17187 bpr 74
    <input size="14" name="methparm4" value="$methparm4">
16117 bpr 75
    !formselect methparm5 from 1 to 4 prompt <,>,<=,>=
17187 bpr 76
    <input size="14" name="methparm6" value="$methparm6">
20 reyssat 77
  !else
16117 bpr 78
    !set methparmrelax=3,4,5,6
79
    !read deduc/methparm.phtml 2
20 reyssat 80
  !endif
81
  !set methsubstep=1
16117 bpr 82
!endif
20 reyssat 83
!exit
84
:check
16117 bpr 85
!bound $methparm3 between integer 0 and 2 default 0
86
!if $methparm3=0
20 reyssat 87
  error=empty_data
88
  !exit
16117 bpr 89
!endif
90
pm3=$methparm3
91
!if $methparm3=3
20 reyssat 92
  pm3=1
93
  !distribute item $methparmobj2 into data,left2,sign2,right2
16117 bpr 94
!endif
95
n=!linecnt $(mtobj$pm3)
96
!if $(methparm$pm3)=0
20 reyssat 97
  error=empty_data
98
  !exit
16117 bpr 99
!endif
100
!distribute item $(methparmobj$pm3) into data,left1,sign1,right1
101
oldineq=$left1 $sign1 $right1
102
!distribute item >,<,= into gt,lt,eq
103
!if $gt isin $sign1
20 reyssat 104
  sign1=!translate internal $gt to $lt in $sign1
105
  !exchange left1,right1
16117 bpr 106
!endif
107
!if $methparm3!=3
20 reyssat 108
  left2=$methparm4
109
  sign2=!item $methparm5 of <,>,<=,>=
110
  right2=$methparm6
16117 bpr 111
!endif
112
!read deduc/sub/simplify $left2 $sign2 $right2
113
newineq=$out
114
!if $gt isin $sign2
115
    sign2=!translate internal $gt to $lt in $sign2
116
    !exchange left2,right2
117
!endif
118
!if $pm3=2
20 reyssat 119
  !exchange sign1,sign2
120
  !exchange left1,left2
121
  !exchange right1,right2
16117 bpr 122
!endif
123
tester=($right1)-($left1)-($right2)+($left2)
124
!if $eq isin $sign1 and $eq notin $sign2
20 reyssat 125
  sign=<
16117 bpr 126
!else
20 reyssat 127
  sign=<=
16117 bpr 128
!endif
129
!read deduc/sub/checkineq $tester,$sign,0
130
test=!word 1 of $out
131
!if $test notwordof true false
20 reyssat 132
  out=!exec maxima negsumdispflag:false;\
16117 bpr 133
 	  expand($maximasimp(($right1)-($left1)));\
134
 	  expand($maximasimp(($right2)-($left2)));\
135
 	  negsumdispflag:true;
20 reyssat 136
  !distribute lines $out into none,i1,i2
137
  out=!exec mathexp cut addition\
138
$i1\
139
$i2
140
  !distribute lines $out into t1,t2
141
  !distribute item $t1 into a1,a2,a3
142
  !distribute item $t2 into b1,b2,b3
143
  !if $a1=$empty
16117 bpr 144
    a1=$a2 $a3
20 reyssat 145
  !endif
146
  !if $b1=$empty
16117 bpr 147
    b1=$b2 $b3
20 reyssat 148
  !endif
149
  !read deduc/sub/checknumber ($a1)/($b1)
150
  !if $out notsametext true
16117 bpr 151
    test=bad
20 reyssat 152
  !else
16117 bpr 153
    tester=($right1)-($left1)-(($a1)/($b1))*(($right2)-($left2))
154
    !read deduc/sub/checkineq $tester,$sign,0
155
    test=!word 1 of $out
20 reyssat 156
  !endif
16117 bpr 157
!endif
158
!if $test notwordof true false
20 reyssat 159
  error=unjustified
160
  !if $methparm3=3
16117 bpr 161
    !advance penalty
20 reyssat 162
  !endif
163
  !exit
16117 bpr 164
!endif
165
!if $test=false
20 reyssat 166
  error=Votre implication n'est pas vraie !
167
  !advance penalty
168
  !exit
16117 bpr 169
!endif
170
oldobject=$pm3
171
newobject$pm3=$newineq
172
methexp=!item $pm3 of Parce que \($oldineq),\
20 reyssat 173
	Implique \($oldineq)
174
!exit