root/trunk/examples/symdiff/SCRIPT.txt

Revision 4662, 1.0 KB (checked in by pmoura, 5 days ago)

Updated copyright notice.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1================================================================
2Logtalk - Open source object-oriented logic programming language
3Release 2.35.0
4
5Copyright (c) 1998-2009 Paulo Moura.        All Rights Reserved.
6Logtalk is free software.  You can redistribute it and/or modify
7it under the terms of the "Artistic License 2.0" as published by
8The Perl Foundation. Consult the "LICENSE.txt" file for details.
9================================================================
10
11
12% start by loading the example:
13
14| ?- logtalk_load(symdiff(loader)).
15...
16
17
18% simplify the expression x^1 + x0 - x1
19
20| ?- (x**1 + x*0 - x*1)::simplify(S).
21
22S = 0
23
24yes
25
26
27% differentiate and then simplify the expression 2x^3 + x^2 - 4x
28
29| ?- (2*x**3 + x**2 - 4*x)::diff(D), D::simplify(S).
30
31D = 2*(3*x**2*1)+2*x**1*1-4*1
32S = 2*(3*x**2)+2*x-4
33
34yes
35
36
37% differentiate and then simplify the expression ln(x^2 + 2x - 7) + 4x
38
39| ?- (log(x**2 + 2*x - 7) + 4*x)::diff(D), D::simplify(S).
40
41D = (2*x**1*1+2*1)*(x**2+2*x-7)** -1+4*1
42S = (2*x+2)*(x**2+2*x-7)** -1+4
43
44yes
Note: See TracBrowser for help on using the browser.