Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
20 reyssat 1
!set methtit=Add two inequalities
2
!set methenv=ZZ QQ RR
3
!set methparmtype=parm inequality >,parm inequality >
4
!set methhelp=This method applies the following property on two existing\
5
inequalities, to deduce a third one:\
5763 bpr 6
 <div class="wimscenter">\
20 reyssat 7
 If \(a > b) and \(c > b), then \(a+c > b+d) .\
5763 bpr 8
</div>\
20 reyssat 9
 The last inequality will be put into the hypotheses.
10
 
11
!if $wims_read_parm iswordof form check
16120 bpr 12
  !goto $wims_read_parm
20 reyssat 13
!endif
14
 
15
!exit
16
:form
17
 Add the inequalities
16120 bpr 18
!read deduc/methparm.phtml 1
20 reyssat 19
 and
16120 bpr 20
!read deduc/methparm.phtml 2
20 reyssat 21
 
22
!exit
23
:check
16120 bpr 24
!distribute items $methparmobj1 into data,left1,sign1,right1
25
!distribute items $methparmobj2 into data,left2,sign2,right2
26
methexp=Add \($left1 $sign1 $right1) and \($left2 $sign2 $right2)
27
 
28
gt=>
29
lt=<
30
!if ($gt isin $sign1 and $lt isin $sign2) or\
20 reyssat 31
	($lt isin $sign1 and $gt isin $sign2)
32
  !exchange left2,right2
16120 bpr 33
!endif
34
!read deduc/sub/simplify $left1 + ($left2)\
35
	$right1 + ($right2)
36
!distribute lines $out into newleft, newright
37
!if $newleft=$empty or $newright=$empty
20 reyssat 38
  error=bad_data
39
  !exit
16120 bpr 40
!endif
20 reyssat 41
 
16120 bpr 42
!if $gt isin $sign1
20 reyssat 43
  s_=>
16120 bpr 44
!else
20 reyssat 45
  s_=<
16120 bpr 46
!endif
47
eq=$empty=
48
!if $eq isin $sign1 and $eq isin $sign2
49
 s_=$s_=
50
!endif
51
newobject0=$newleft $s_ $newright
52
oldobject=0
20 reyssat 53
 
16120 bpr 54
contextlist=$ct_Always,\
20 reyssat 55
	$ct_Onlywhen the two inequalities are positive,\
56
	$ct_Onlywhen one of the two inequalities is positive,\
57
	$ct_Onlywhen one of the two inequalities is of the same sign
58
 
59
!exit